Results 1 to 9 of 9

Thread: Api - SendMessage

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2002
    Posts
    23

    Api - SendMessage

    does any one knows why is it that when i call a WM_ message
    for the API "SendMessage" function,
    it is always an empty WM_
    while it suppose to be signed &HD or &C1 values or something like that ?

  2. #2
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    i don'ts know what yous mean?

  3. #3
    Megatron
    Guest
    Did you remember to define the constant?

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jan 2002
    Posts
    23
    this is exactly my problem
    lets say i want to use the WM_CLOSEWINDOW,
    how do i know what to define ?????????????
    const WMCLOSEWINDOW = &???????

  5. #5
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    you find out

    it's WM_CLOSE

    the value is &H10

    Private Const WM_CLOSEWINDOW = &H10



    Use the API viewer

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Jan 2002
    Posts
    23
    Thank you so much !!!!!!!!!!!!!!!!!!!!
    :-)

    can you tell me how can i use sendMessage inorder to resize
    a remote window from within my program ?

    i intend to turn a remote dos window in to a FULL SCREEN mode, but no mater what i do, it wont work. i tried everything !!


    can you also tell me how/where can i look for those codes my self ?

    thank you again.

  7. #7
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    something like this?
    VB Code:
    1. Private Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
    2. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    3. Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
    4. Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
    5. Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
    6. Private Sub Form_Load()
    7.     Dim MyStr As String
    8.     Dim dosHand As Long
    9.     dosHand = FindWindow("tty", vbNullString)
    10.     MyStr = String(GetWindowTextLength(dosHand) + 1, Chr$(0))
    11.     GetWindowText dosHand, MyStr, Len(MyStr)
    12.     AppActivate MyStr
    13.     SendKeys "%~"
    14.     AppActivate MyStr
    15.     End
    16. End Sub

    ?

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Jan 2002
    Posts
    23

    help

    thanx again
    :-)

    you see, the code you gave me sets the dos window to a normal size, i tried playing with it, but..

    i tried already:
    ShowWindow hwnd, 3 (API function), but it will return a big dos screen (not totaly full screen)

    then i tried:
    SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, wFlags)
    but it only sets the focus to the minimized tab of the dos window on the toolbar, but not resizing it.

    what happenes it that when i move from the dos program to the vb program, it makes the dos window minimized, and i want to return from the vb program to the dos program but it wont return to the dos's TOTALY FULL SCREEN mode (the one you can make by pressing Alt & Enter on a dos window)

    i hope you are not troubled by me but chalanged :-)
    thank you

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Jan 2002
    Posts
    23
    can anyone please help?

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