Results 1 to 6 of 6

Thread: Two questions and one more ;)

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    11

    Question Two questions and one more ;)

    First question:

    I have disabled the max button in my form, but I can still resize it by moveing coursor at the end of the form. How can I disable it?

    Second question:

    How can I do that, when my prog starts its "status" isn`t at the task bar, but in the field where is for example Time (also at the task bar but in the special fileld). So, when I push "x" in my prog it won`t exit, but will be at "standby mode" at the task bar in the special field. How to do this?

    Last edited by PijakFranciszek; Oct 31st, 2002 at 06:21 AM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    1. Set the form to Fixed Single

    2.
    VB Code:
    1. Private Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
    2.  
    3. Private Type NOTIFYICONDATA
    4.     cbSize As Long
    5.     hWnd As Long
    6.     uId As Long
    7.     uFlags As Long
    8.     ucallbackMessage As Long
    9.     hIcon As Long
    10.     szTip As String * 64
    11. End Type
    12.  
    13. Private Const NIM_ADD = &H0
    14. Private Const NIM_MODIFY = &H1
    15. Private Const NIM_DELETE = &H2
    16. Private Const WM_MOUSEMOVE = &H200
    17. Private Const NIF_MESSAGE = &H1
    18. Private Const NIF_ICON = &H2
    19. Private Const NIF_TIP = &H4
    20. Private Const WM_LBUTTONDBLCLK = &H203
    21. Private Const WM_LBUTTONDOWN = &H201
    22. Private Const WM_LBUTTONUP = &H202
    23. Private Const WM_RBUTTONDBLCLK = &H206
    24. Private Const WM_RBUTTONDOWN = &H204
    25. Private Const WM_RBUTTONUP = &H205
    26.  
    27. Private SysTray As NOTIFYICONDATA
    28.  
    29. Private Sub StartInSysTray()
    30.     SysTray.cbSize = Len(SysTray)
    31.     SysTray.hwnd = Picture1.hwnd
    32.     SysTray.uId = 1&
    33.     SysTray.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
    34.     SysTray.ucallbackMessage = WM_MOUSEMOVE
    35.     SysTray.hIcon = Me.Icon
    36.     SysTray.szTip = "&R&e&s&t&a&r&t" & Chr$(0)
    37.     Shell_NotifyIcon NIM_ADD, SysTray
    38.     Me.Hide
    39.     App.TaskVisible = False
    40. End Sub
    41.  
    42. Private Sub Form_Load()
    43. StartInSysTray
    44. End Sub
    45.  
    46. Private Sub Form_Unload(Cancel As Integer)
    47.     SysTray.cbSize = Len(SysTray)
    48.     SysTray.hwnd = Picture1.hwnd
    49.     SysTray.uId = 1&
    50.     Shell_NotifyIcon NIM_DELETE, SysTray
    51. End Sub
    52.  
    53. 'Add A Picture Control To The Form.   Set its visible property to False
    54. Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    55.  
    56. Static rec As Boolean, msg As Long
    57.     Dim RetVal As String
    58.     Dim returnstring
    59.     Dim retvalue
    60.     msg = X / Screen.TwipsPerPixelX
    61.     If rec = False Then
    62.         rec = True
    63.     Select Case msg
    64.     Case WM_LBUTTONDOWN
    65.    
    66.     Case WM_LBUTTONDBLCLK
    67.          
    68.     Case WM_LBUTTONUP
    69.          
    70.     Case WM_RBUTTONUP
    71.          
    72.     End Select
    73.         rec = False
    74.     End If
    75.  
    76. End Sub

  3. #3
    Junior Member -_MAD-HATTAH_-'s Avatar
    Join Date
    Sep 2002
    Location
    PHX AZ
    Posts
    25
    Uhh for ur first ? U can use 'windowstate'

    Form1.Windowstate = 2 'for full screen (i think)

    I'll have to chec back with you when I get home..I'm at lunch right now at skool. I'll post again later when i'm 100% sure
    -_MAD-HATTAH_-

  4. #4

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    11
    Thanks for the help

  5. #5

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    11

    Question

    Yes, but something wrong is in this code, becouse the form start in the TaskBar (in the special field), but I can`t open it (there`s only a icon - double click does nothing). Oh, almost I forgot - how do that when I right click on the icon in special field I would open a menu with exit (right click menu)?


  6. #6
    Fanatic Member scr0p's Avatar
    Join Date
    Oct 2002
    Location
    VA
    Posts
    720
    Make an invisible menu with menu editor, then use PopUpMenu, I attached an example, I don't know if it will work with the Sys icon but Its the same concept.
    Attached Files Attached Files

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