Results 1 to 2 of 2

Thread: A Window Problem

  1. #1
    Guest

    Post

    When someone resizes i want the edit box to resize, but i dont how to get the size of the window. Any ideas?

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    Can you not use GetWindowRect
    Code:
    ;preserve eax and ebx
    push eax
    push ebx
    
    ;get the address of a rect structure
    lea ebx, A_Rect_Structure
    
    ;fill it with the windows rectangle
    push ebx
    push HWND_OF_Window
    call GetWindowRect
    
    ;Translate the coordinates into window coordinates
    push ebx
    push HWND_OF_Window
    call ScreenToClient
    inc ebx, 8
    push ebx
    push HWND_OF_Window
    call GetWindowRect
    
    ;restore eax and ebx
    pop ebx
    pop eax
    I don't know If you have to clear the parameters off the call stack after calling an API, I didn't but If you need to you can. After this code the Left and Bottom parts of the Rect structure should be the window's width and height respectivley.
    If it wasn't for this sentence I wouldn't have a signature at all.

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