1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
// D_UsbPanel.cpp : fichier d'implémentation
//
#include "stdafx.h"
#include "D_UsbPanel.h"
// Boîte de dialogue D_UsbPanel
IMPLEMENT_DYNAMIC(D_UsbPanel, CDialog)
D_UsbPanel::D_UsbPanel(CWnd* pParent /*=NULL*/)
: CDialog(D_UsbPanel::IDD, pParent)
{
}
BOOL D_UsbPanel::OnInitDialog()
{
CDialog::OnInitDialog();
int posX = m_resX-470; //m_resX : var globale resolution en X
int posY =m_resY-470; //m_resY : var globale resolution en Y
//Chargement du GIF animé
if (usb_gif.Load(MAKEINTRESOURCE(IDR_USBHELP),_T("GIF")))
usb_gif.Draw();
usb_gif.SetWindowPos(&wndBottom,0,0,400,400,SWP_SHOWWINDOW);
MoveWindow(posX,posY,400,400);
//Démarrge du décompte avant fermeture
AfxBeginThread(closingThread, this);
return TRUE;
}
D_UsbPanel::~D_UsbPanel()
{
}
void D_UsbPanel::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_USBGIF, usb_gif);
}
//Fermeture de la fenetre, renvoi IDOK
void D_UsbPanel::Close()
{
EndDialog(IDOK);
}
BEGIN_MESSAGE_MAP(D_UsbPanel, CDialog)
END_MESSAGE_MAP()
// Gestionnaires de messages de D_UsbPanel
UINT closingThread(LPVOID pvParam)
{
//AfxMessageBox(_T("Je suis dans le thread..."));
D_UsbPanel *pThis=(D_UsbPanel *) pvParam ;
//Pause de 3.6secondes
Sleep(3600);
pThis->Close();
//AfxEndThread( 0 );
return 0;
} |
Partager