Ribbon in Access 2007 works incorrect

T

Tuan Anh

Hi! I am writting application with access 2007, I have problem about ribbon.
please help me.
In access 2007, I create class and form by API function (my purpose draw
ordanization chart). However, after I run that form, Ribbon in Access 2007
worksed incorrect.
To give a concrete: open one form with design status and order form with
form view status. Ribbon of design status not appear.

This my code to form

Public Function vbWinMain() As Long
Const CLASSNAME = "Hello_VB"
Const TITLE = "Organization chart"

Dim hwnd As Long
Dim wc As WNDCLASSEX
Dim message As Msg
Dim lngStyle As Long
Dim CS As CREATESTRUCT
Dim RecWin As RECT

' Set up and register window class
wc.cbSize = Len(wc)
wc.style = CS_HREDRAW Or CS_VREDRAW
wc.lpfnWndProc = GetFuncPtr(AddressOf WindowProc)
wc.cbClsExtra = 0&
wc.cbWndExtra = 0&
wc.hInstance = 0& 'Application.hWndAccessApp
wc.hIcon = 0& 'LoadIcon(Application.hWndAccessApp, IDI_APPLICATION)
wc.hCursor = 0& 'LoadCursor(Application.hWndAccessApp, IDC_ARROW)
wc.hbrBackground = GetStockObject(WHITE_BRUSH)
wc.lpszMenuName = 0&
wc.lpszClassName = CLASSNAME
wc.hIconSm = 0& 'LoadIcon(Application.hWndAccessApp, IDI_APPLICATION)

RegisterClassEx wc


GetWindowRect GetDesktopWindow, RecWin

' Create a window
hwnd = CreateWindowEx(0&, _
CLASSNAME, _
TITLE, _
WS_EX_APPWINDOW, _
CW_USEDEFAULT, _
CW_USEDEFAULT, _
RecWin.Right, _
RecWin.Bottom, _
0&, _
0&, _
0&, _
0&)

' Show the window

ShowWindow hwnd, SW_SHOWNORMAL
UpdateWindow hwnd
SetFocus hwnd

SetWindowPos hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or
SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE

'enter message loop
'(all window messages are handles in WindowProc())
Do While 0 <> GetMessage(message, 0&, 0&, 0&)
TranslateMessage message
DispatchMessage message
Loop

vbWinMain = message.wParam
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top