Results 1 to 4 of 4

Thread: A Few Q's

  1. #1
    Guest

    Post

    How do i get the X and Y coordinates of the mouse?
    How do i get the handle of a device context?
    If there is a static label on a dialog, what message should should i put the code to change the label in?

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    Pos of the mouse.
    Code:
    POINT pt;
    GetCursorPos(&pt);
    xcoord = pt.x;
    ycoord = pt.y;
    Handle of a DC
    Code:
    HDC mydc = GetDC(hwnd);

    I am become death, the destroyer of worlds.
    mail:vlatkovr@hotmail.com

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3
    Guest
    GetDC will get the client area of the Window. If you want the whole window, use GetWindowDC.

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Use:
    Code:
    SendMessage(GetDlgItem(hWnd_Dlg, IDC_STATIC), WM_SETTEXT, 0, (LPARAM)pcNewCaption);
    where pcNewCaption contains your string.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width