C'est la première solution que j'ai choisie mais quand je clique sur "AIDE" rien ne se passe. Je pense que j'utilise mal cette fonction CreateWindowsEx(). Voici ce que j'ai fait (en résumé) :
#include <windows.h> using namespace std;
/* Declare Windows procedure */ LRESULT CALLBACK WindowProcedure(HWND, UINT, WPARAM, LPARAM); /* Make the class name into a global variable */ char szClassName[ ] = "WindowsApp"; int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil) { HWND hwnd; /* This is the handle for our window */ MSG messages; /* Here messages to the application are saved */ WNDCLASSEX wincl; /* Data structure for the windowclass */
/* The Window structure */ ... } /* This function is called by the Windows function DispatchMessage( ) */ LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) /* handle the messages */ { case WM_COMMAND: { case 104: { HINSTANCE hInstance; HWND hwnd2; /* This is the handle for our window */ WNDCLASSEX wincl2; /* Data structure for the windowclass */
/* The Window structure */ wincl2.hInstance = hInstance; wincl2.lpszClassName = szClassName; wincl2.lpfnWndProc = WindowProcedure; /* This function is called by windows */ wincl2.style = CS_DBLCLKS; /* Catch double-clicks */ wincl2.cbSize = sizeof(WNDCLASSEX);
/* Register the window class, if fail quit the program */ if(!RegisterClassEx(&wincl2)) return 0;
/* The class is registered, let's create the program*/ hwnd2 = CreateWindowEx( WS_EX_CLIENTEDGE, /* Extended possibilites for variation */ szClassName, /* Classname */ "Présentation", /* Title Text */ WS_CHILD, CW_USEDEFAULT, /* Windows decides the position */ CW_USEDEFAULT, /* where the window ends up on the screen */ 544, /* The programs width */ 375, /* and height in pixels */ HWND_DESKTOP, NULL, /* No menu */ hInstance, /* Program Instance handler */ NULL /* No Window Creation data */ ); ShowWindow(hwnd2, SW_SHOW); WinHelp (hwnd2,"D:\\Data\\C++\\MesProjets\\Projet1\\HLP32\\GENXMLAIDE.HLP>Présentation",HELP_CONTENTS,0); break; } } // fin du switch pour la gestion du menu } // fin du WM_COMMAND }
|