How does C code become windows program ? do you design your app windows in Visual studio and paste code on buttons sort of like creating hyperlinks and hotspots on a web page ?
just curious
thanx..
How does C code become windows program ? do you design your app windows in Visual studio and paste code on buttons sort of like creating hyperlinks and hotspots on a web page ?
just curious
thanx..
its alive... its ALIVE... ITS...AL...IIIVE !!!!!!!!!
For dialog style applications, pretty much.
The world is waiting. I must leave you now.
I am not sure I understand your question quite well but perhaps this might help
NeHe OpenGL Programming
Asking the right question is sometimes more important than knowing the answer.
Please read the FAQ
C Reference Card (A MUST!)
Pointers and Memory
The Essentials
CString lib
im not 100% sure but if you are talking about your code and wanting it to work in windows, I think you have to add a windows header file to access that stuff. Havn't learned it myself yet but that will be to come.
or probably this would be the answer to your mystical question,
win32api is made using the c language, so by using these win32 functions, your c code becomes a win32 program,
Code:#include <windows.h> LRESULT CALLBACK WindowFunc(HWND, UINT, WPARAM, LPARAM); char szWinName[] = "MyWin"; int WINAPI WinMain(HINSTANCE hThisInst, HINSTANCE hPrevInst, LPSTR lpszArgs, int nWinMode) { HWND hwnd; MSG msg; WNDCLASSEX wcl; wcl.cbSize = sizeof(WNDCLASSEX); wcl.hInstance = hThisInst; wcl.lpszClassName = szWinName; wcl.lpfnWndProc = WindowFunc; wcl.style = 0; wcl.hIcon = LoadIcon(NULL, IDI_APPLICATION); wcl.hIconSm = NULL; wcl.hCursor = LoadCursor(NULL, IDC_ARROW); wcl.lpszMenuName = NULL; wcl.cbClsExtra = 0; wcl.cbWndExtra = 0; if(!RegisterClassEx(&wcl)) return 0; hwnd = CreateWindow( szWinName, "A Window", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hThisInst, NULL); ShowWindow(hwnd, nWinMode); UpdateWindow(hwnd); while(GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return msg.wParam; } LRESULT CALLBACK WindowFunc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch(message) { case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hwnd, message, wParam, lParam); } return 0; }
The world is waiting. I must leave you now.