-
win32..textout
Hi,
I am very new to Win32 programming.I have the following working progarm which displays a small simple win32 app
(window)
Now I want to write and display a text "THIS IS MY FIRST WINDOW"
I need to use TEXTOUT out function but not sure where to ?
will anyone please help me with that so I can play with the codes
Thanks
PHP Code:
#include <windows.h>
#include <string.h>
const char *CLASSNAME = "Tutorial", *WINNAME = "Tutorial 2 - The Window";
LRESULT CALLBACK WndProc(HWND hWnd, unsigned int iMessage, WPARAM wParam, LPARAM lParam);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow)
{
HWND hWnd;
MSG Message;
WNDCLASS WndClass;
// NOTE: The memset() here is added to deal with this code crashing on
// WinNT (reported by Girish Deodhar, solution due to him as well)
// The extra include statement is for memset() too...
memset(&WndClass, 0, sizeof(WndClass));
WndClass.cbClsExtra = 0;
WndClass.cbWndExtra = 0;
// Typecast added. This line generated compiler errors on some
// compilers previously. Thanks goes to Anton Rapoport for the tip.
WndClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
WndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
WndClass.hIcon = LoadIcon(hInstance, NULL);
WndClass.hInstance = hInstance;
WndClass.lpfnWndProc = WndProc;
WndClass.lpszClassName = CLASSNAME;
WndClass.style = CS_HREDRAW | CS_VREDRAW;
if(!RegisterClass(&WndClass))
return 0;
hWnd = CreateWindow(CLASSNAME, WINNAME, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, 300, 100,
NULL, NULL, hInstance, NULL);
ShowWindow(hWnd, nCmdShow);
while(GetMessage(&Message, hWnd, 0, 0))
{
TranslateMessage(&Message);
DispatchMessage(&Message);
}
return Message.wParam;
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam)
{
switch(iMessage)
{
case WM_CLOSE:
case WM_DESTROY:
if(MessageBox(hWnd, "Do you really want to quit?", "Message", MB_YESNO) == IDYES)
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, iMessage, wParam, lParam);
}
return 0;
}
-
Re: win32..textout
Application Deployment????