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
|
#include <windows.h>
HINSTANCE hGetProcIDDLL =LoadLibrary("C:/WINDOWS/system32/atl.dll");
FARPROC lpfnGetProcessID = GetProcAddress(HMODULE (hGetProcIDDLL),"AtlAxWinInit");
DialogBoxParam(0,1001,0,hWndProc);
char title[]="WinAPI Web Browser";
LRESULT CALLBACK hWndProc(HWND hWnd,UINT uInt,WPARAM wparam,LPARAM lparam){
switch(uInt)
{ case WM_CLOSE:
{
exit(0);
break;}
case 0x2:{
PostQuitMessage(0);
break; }
default:
return DefWindowProc(hWnd,uInt,wparam,lparam);
}}
int WINAPI WinMain(HINSTANCE hinstance,HINSTANCE hInstance2,LPSTR lpstr,int number){
WNDCLASS clas;
MSG msg;
HWND hWnd;
clas.hInstance=hinstance;
clas.lpszClassName=title;
clas.lpfnWndProc=hWndProc;
clas.hbrBackground=GetSysColorBrush(COLOR_3DFACE);
RegisterClass(&clas);
CreateWindow(clas.lpszClassName,title,WS_VISIBLE|0xcf0000,5,5,1050,950,0,0,hinstance,0);
while(GetMessage(&msg,NULL,0,0)){
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
|