Results 1 to 4 of 4

Thread: SendMessage Not Defined??? [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2001
    Posts
    525

    Question SendMessage Not Defined??? [RESOLVED]

    Can someone tell my why it keeps saying SendMessage "Sub or Function not defined"?

    VB Code:
    1. Call SetDefaultPrinter(Simplex, DriverName, PortName)

    VB Code:
    1. Declare Function WriteProfileString Lib "KERNEL32" _
    2. Alias "WriteProfileStringA" _
    3. (ByVal lpszSection As String, _
    4. ByVal lpszKeyName As String, _
    5. ByVal lpszString As String) As Long
    6.  
    7. Public Const HWND_BROADCAST = &HFFFF
    8. Public Const WM_WININICHANGE = &H1A
    9.  
    10. Public Sub SetDefaultPrinter(ByVal PrinterName As String, _
    11.     ByVal DriverName As String, ByVal PrinterPort As String)
    12.     Dim DeviceLine As String
    13.     Dim r As Long
    14.     Dim l As Long
    15.     DeviceLine = PrinterName & "," & DriverName & "," & PrinterPort
    16.     ' Store the new printer information in the [WINDOWS] section of
    17.     ' the WIN.INI file for the DEVICE= item
    18.     r = WriteProfileString("windows", "Device", DeviceLine)
    19.     ' Cause all applications to reload the INI file:
    20.     l = SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0, "windows")
    21. End Sub
    Last edited by jsun9; Jan 15th, 2004 at 02:02 PM.

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