Is this working?Can u compile this pls?

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
#include <windows.h>
#include <iostream>
using namespace std;
LRESULT CALLBACK P(HWND,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE A,HINSTANCE B,LPSTR C,int d){
string title="Window";
char *b;
for(int i=0;i<title.length();i++)
b[i]=title[i];
HWND E;
MSG G;
WNDCLASS F={0}; 
F.hInstance=A;
F.lpszClassName=b;
F.lpfnWndProc=P;
F.hbrBackground=GetSysColorBrush(COLOR_3DFACE);
RegisterClass(&F);
CreateWindow(F.lpszClassName,b,0xcf0000|WS_VISIBLE,50,150,600,450,0,0,A,0);
while(GetMessage(&G,NULL,0,0)){
TranslateMessage(0);
DispatchMessage(0);
}return G.wParam;
}
LRESULT CALLBACK P(HWND A,UINT B,WPARAM C,LPARAM D){
switch(B){
case 0x2:
PostQuitMessage(0);
break;
default:
return DefWindowProc(A,B,C,D);
}
return 0;
}
It looks alright, no I won't compile it for you if you don't have access to a compiler then use http://codepad.org/

A problem I see is that the messages never get sent to your call back function so this program won't react to them.
closed account (1yR4jE8b)
And this is where I see the usefullness of code-tags completely ignored...
Topic archived. No new replies allowed.