G37Sam
Registered User.
- Local time
- , 01:12
- Joined
- Apr 23, 2008
- Messages
- 454
Hello fella's,
 
Is there a way to set/alter the position (center screen?) of an API Color Chooser dialog upon its creation?
 
It keeps popping up on the upper left corner of my screen which I can't stand.
 
Below is the code in the module
 
	
	
	
		
 
Then I just call DialogColor from a form.. any help would be greatly appreciated
 
Cheers,
Sam
 Is there a way to set/alter the position (center screen?) of an API Color Chooser dialog upon its creation?
It keeps popping up on the upper left corner of my screen which I can't stand.
Below is the code in the module
		Code:
	
	
	Option Compare Database
'This code was originally written by Terry Kreft,
'and modified by Stephen Lebans
'It is not to be altered or distributed,
'except as part of an application.
'You are free to use it in any application,
'provided the copyright notice is left unchanged.
'
' Contact [EMAIL="Stephen@lebans.com"]Stephen@lebans.com[/EMAIL]
'
Private Type COLORSTRUC
  lStructSize As Long
  hwnd As Long
  hInstance As Long
  rgbResult As Long
  lpCustColors As String
  Flags As Long
  lCustData As Long
  lpfnHook As Long
  lpTemplateName As String
End Type
Private Const CC_SOLIDCOLOR = &H80
Private Declare Function ChooseColor Lib "comdlg32.dll" Alias "ChooseColorA" (pChoosecolor As COLORSTRUC) As Long
 
Public Function DialogColor() As Long
Dim x As Long, CS As COLORSTRUC, CustColor(16) As Long
CS.lStructSize = Len(CS)
CS.hwnd = Application.hWndAccessApp
CS.Flags = CC_SOLIDCOLORw
CS.lpCustColors = String$(16 * 4, 0)
x = ChooseColor(CS)
DialogColor = CS.rgbResult
End FunctionThen I just call DialogColor from a form.. any help would be greatly appreciated
Cheers,
Sam
 
	 
 
		

 
 
		 
 
		
 
 
		