// Global Variables:
HINSTANCE hInst; // current instance
TCHAR szTitle[MAX_LOADSTRING]; // The title bar text
TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name
// Forward declarations of functions included in this code module:
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
HWND hletter;
HWND hWnd_i;
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
// TODO: Place code here.
MSG msg;
HACCEL hAccelTable;
// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}
//
// FUNCTION: MyRegisterClass()
//
// PURPOSE: Registers the window class.
//
// COMMENTS:
//
// This function and its usage are only necessary if you want this code
// to be compatible with Win32 systems prior to the 'RegisterClassEx'
// function that was added to Windows 95. It is important to call this function
// so that the application will get 'well formed' small icons associated
// with it.
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX wcex;
//
// FUNCTION: InitInstance(HINSTANCE, int)
//
// PURPOSE: Saves instance handle and creates main window
//
// COMMENTS:
//
// In this function, we save the instance handle in a global variable and
// create and display the main program window.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND hWnd;
hInst = hInstance; // Store instance handle in our global variable
// Associate the tooltip with the "tool" window.
SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti);
//SendMessage( hwndTT, TTM_UPDATETIPTEXT, 0, (LPARAM)&ti);
//SendMessage(hwndTT, TTM_SETMAXTIPWIDTH, 0,200);
htooltip=hwndTT;
//SendMessage(hwndTT, TTM_SETMAXTIPWIDTH, 0, strlen(s));
//ShowWindow(hwndTT, SW_SHOW);
}
LRESULT CALLBACK WndProcAL(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
static bool g_TrackingMouse=false;
PAINTSTRUCT ps;
HDC hdc;
static WORD oldx=0,oldy=0;
WORD x,y;
static int sec=0;
switch (message)
{
case WM_CREATE:
CreateToolTipForRect(hWnd_i,hWnd,"essaintoto");
break;
case WM_TIMER:
{
sec++;
if (sec==3)
{
//if (htooltip==NULL)
}
}
break;
case WM_MOUSELEAVE:
// The mouse pointer has left our window.
// Deactivate the tooltip.
SendMessage(htooltip, TTM_TRACKACTIVATE, (WPARAM)FALSE, (LPARAM)&ti);
g_TrackingMouse = FALSE;
return FALSE;
case WM_MOUSEMOVE:
{
if (!g_TrackingMouse)
// The mouse has just entered the window.
{
// Request notification when the mouse leaves.
TRACKMOUSEEVENT tme = { sizeof(TRACKMOUSEEVENT) };
tme.hwndTrack = hWnd;
tme.dwFlags = TME_LEAVE;
TrackMouseEvent(&tme);
// Position the tooltip.
// The coordinates are adjusted so that the tooltip does not
// overlap the mouse pointer.
POINT pt = { x, y };
ClientToScreen(hWnd, &pt);
SendMessage(htooltip, TTM_TRACKPOSITION,
0, (LPARAM)MAKELONG(pt.x + 10, pt.y - 20));
oldx=x;
oldy=y;
}
//SetFocus(hWnd);
return FALSE;
}
break;
case WM_PAINT:
{
hdc = BeginPaint(hWnd, &ps);
RECT rc;
GetClientRect(hWnd,&rc);
DWORD cl=RGB(0xd0,0xd0,0xe0);
HBRUSH hbr=CreateSolidBrush(cl);
FillRect(hdc,&rc,hbr);