|
- Un cours sur l'API Win 32 : http://texel3d.free.fr/win32/intro.htm
- Avec Dev C++ 4
Créez un nouveau projet : il y en a 5 sortes
- Window application
- console application (mode console)
- WinMain() project
- DLL
- Empty project (pour un projet téléchargé
ou recopié)
- Pour un projet Window application, Dev C++ 4 crée
la fonction principale :
int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance,
LPSTR lpszArgument, int nFunsterStil) où il n'y a presque
rien à modifier,
et la procédure de fenêtre :
LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM
wParam, LPARAM lParam)
où il suffit d'ajouter des cases dans le switch(message)
{
case WM_CREATE:
// init
SetTimer(hwnd, idTimer1, nTimerDelay,
NULL);
break;
case WM_KEYDOWN:
case WM_TIMER:
case WM_PAINT:
- La librairie SDK pour le développement
d'application Windows, 800 fonctions.
hbitmap = (HBITMAP) LoadImage(NULL,"image.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
hdcMemory = CreateCompatibleDC(NULL);
SelectObject(hdcMemory, hbitmap);
GetObject(hbitmap, sizeof(bm), &bm);
BitBlt(hdc,20,80,bm.bmWidth, bm.bmHeight, hdcMemory, 0, 0, SRCCOPY);
hdcMemory = GetDC(NULL);
DeleteDC(hdcMemory);
- La librairie MFC pour
les objets Windows : CDC, CEdit, CButton, CFont, CBitmap, CImageList
, CPoint ...
CDC::TextOut(), CBitmap::LoadBitmap(IDB_BMP0) , CImageList::Draw(pDC,
0, m_pt3 , ILD_NORMAL)
CDC::DrawIcon(x, y, m_hIconRess) ... ... ...
Mais elle n'est pas indispensable.
|
|
|