A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Ribbon in Access 2007 works incorrect



 
 
Thread Tools Display Modes
  #1  
Old July 11th, 2009, 03:54 AM posted to microsoft.public.access
Tuan Anh
external usenet poster
 
Posts: 3
Default Ribbon in Access 2007 works incorrect

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

  #2  
Old July 11th, 2009, 04:20 AM posted to microsoft.public.access
Tuan Anh[_2_]
external usenet poster
 
Posts: 4
Default Ribbon in Access 2007 works incorrect

In my code have use ACTIVESKINLib

mASkin.LoadSkin Path
mASkin.ApplySkin hwnd

I have example with activeskin 4.3

First you open form1 and click command, close form1
then you open form2 with design staus and form3 with form view status
then change between form2 and form3, ribbon design form2 not appear

this link file

http://www.4shared.com/file/11732310...Database3.html

thanks

"Tuan Anh" wrote:

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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:20 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.