Results 1 to 4 of 4

Thread: Xp Look

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 1999
    Location
    Proctor,Vt USA
    Posts
    47

    Question Xp Look

    Used this from the code bank
    VB Code:
    1. Private Declare Function InitCommonControls Lib "comctl32.dll" () As Long
    2. Private Sub MDIForm_Initialize()
    3. InitCommonControls
    4. End Sub
    Adding a manifest file per instructions from the codebank
    My user has a couple desktop database apps that they wanted it to look more along the Xp look
    Tried this approach it works well on one program the next one bombs, won't start up Gives "Run Time Error '7'"
    Out of memory.
    Remove the manifest and everything works fine but no look
    Also in the IDE the program works with the Xp look, no errors
    Any ideas?

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Xp Look

    You may want to try using InitCommonControlsEx instead:
    VB Code:
    1. Const ICC_LISTVIEW_CLASSES = &H1       ' listview, header
    2. Const ICC_TREEVIEW_CLASSES = &H2       ' treeview, tooltips
    3. Const ICC_BAR_CLASSES = &H4            ' toolbar, statusbar, trackbar, tooltips
    4. Const ICC_TAB_CLASSES = &H8            ' tab, tooltips
    5. Const ICC_UPDOWN_CLASS = &H10          ' updown
    6. Const ICC_PROGRESS_CLASS = &H20        ' progress
    7. Const ICC_HOTKEY_CLASS = &H40          ' hotkey
    8. Const ICC_ANIMATE_CLASS = &H80         ' animate
    9. Const ICC_WIN95_CLASSES = &HFF
    10. Const ICC_DATE_CLASSES = &H100         ' month picker, date picker, time picker, updown
    11. Const ICC_USEREX_CLASSES = &H200       ' comboex
    12. Const ICC_COOL_CLASSES = &H400         ' rebar (coolbar) control
    13. Const ICC_INTERNET_CLASSES = &H800
    14. Const ICC_PAGESCROLLER_CLASS = &H1000      ' page scroller
    15. Const ICC_NATIVEFNTCTL_CLASS = &H2000      ' native font control
    16. Private Type InitCommonControlsExType
    17.     dwSize As Long 'size of this structure
    18.     dwICC As Long 'flags indicating which classes to be initialized
    19. End Type
    20. Private Const WS_VISIBLE = &H10000000
    21. Private Const WS_CHILD = &H40000000
    22. Private Declare Sub InitCommonControls Lib "comctl32" ()
    23. Private Declare Function InitCommonControlsEx Lib "comctl32" (init As InitCommonControlsExType) As Boolean
    24. Private Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long
    25. Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long
    26. Dim mWnd As Long
    27. Private Sub Form_Load()
    28.     'KPD-Team 2000
    29.     'URL: [url]http://www.allapi.net/[/url]
    30.     'E-Mail: [email][email protected][/email]
    31.     Const IE3_INSTALLED = True
    32.     If IE3_INSTALLED = True Then
    33.         Dim initcc As InitCommonControlsExType
    34.         initcc.dwSize = Len(initcc)
    35.         initcc.dwICC = ICC_UPDOWN_CLASS
    36.         InitCommonControlsEx initcc
    37.     Else
    38.         InitCommonControls
    39.     End If
    40.     mWnd = CreateWindowEx(0, "msctls_updown32", "KPD UpDown Control", WS_VISIBLE Or WS_CHILD, 0, 0, 50, 100, Me.hwnd, ByVal 0&, ByVal 0&, ByVal 0&)
    41. End Sub
    42. Private Sub Form_Unload(Cancel As Integer)
    43.     DestroyWindow mWnd
    44. End Sub

  3. #3

  4. #4
    Addicted Member Max_aka_NOBODY's Avatar
    Join Date
    Jul 2004
    Location
    Amman, Jordan
    Posts
    179

    Re: Xp Look

    Excuse me, but how would it be poossible for IE3_INSTALLED to return false if it's declared true just before the check?

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