Could not figure out on how to reply to the last article with the same name. When I logged out it asked me to login and when I logged in there was no "post your reply" option, perhaps there is functional bug on this website, anyhow.
I had a similar problem where getting the value was okay but saving the value did not work, so I hope my solution helps, if someone else has a similar issue of understanding how to declare and use api functions.
[FYI: I was designing a user drawn combobox and the "Slide Open Combo Boxes" windows setting was effecting the display of the drop down portion of combo box. I got no text in the header portion and if my DataSource was only a few rows it showed no data at all and the height of the combo was only a few pixels !!?? My workaround was to toggle this windows setting value off then on again in the DropDown and DropDownClosed events respectively: - <DllImport("user32.dll", EntryPoint:="SystemParametersInfoA", SetLastError:=True, _
-
CharSet:=CharSet.Ansi, ExactSpelling:=True, _
-
CallingConvention:=CallingConvention.StdCall)> _
-
Private Function SystemParametersInfoGet(ByVal uiAction As SPI_INDEX, ByVal uiParam As UInteger, _
-
ByRef lpenabled As Boolean, ByVal fWinIni As UInteger) As Boolean
-
End Function
-
<DllImport("user32.dll", EntryPoint:="SystemParametersInfoA", SetLastError:=True, _
-
CharSet:=CharSet.Ansi, ExactSpelling:=True, _
-
CallingConvention:=CallingConvention.StdCall)> _
-
Private Function SystemParametersInfoSet(ByVal uiAction As SPI_INDEX, ByVal uiParam As UInteger, _
-
ByVal lpenabled As Boolean, ByVal fWinIni As UInteger) As Boolean
-
End Function
-
-
Public Function SlideOpenComboBoxes(ByVal TurnOn As Boolean) As Boolean
-
Dim fResult As Boolean
-
Dim spValue As UInteger
-
Dim originalMaskOn As Boolean
-
-
fResult = SystemParametersInfoGet(SPI_INDEX.SPI_GETCOMBOBOXANIMATION, 0, originalMaskOn, SPFIPersistance_INDEX.SPFI_NONE)
-
Dim oWin32Ex As New Win32Exception()
-
If fResult Then
-
If TurnOn <> originalMaskOn Then
-
fResult = SystemParametersInfoSet(SPI_INDEX.SPI_SETCOMBOBOXANIMATION, 0, TurnOn, SPFIPersistance_INDEX.SPFI_NONE)
-
oWin32Ex = New Win32Exception()
-
End If
-
End If
-
If Not fResult Then
-
Throw oWin32Ex
-
End If
-
Return originalMaskOn
-
End Function
-
End Module
I noticed 2 difference in the code snippets provided from the previous article compared to my solution above: - The first was the order of calling the parameters. I passed the variable I want to get or set into the call to the api as the third parameter. The previous article had Return = SystemParameter sInfo(SPI_SETSC REENSAVEACTIVE, lActiveFlag, 0, 0), so maybe the order is incorrect if I am not mistaken.
- The other difference is I have two references to the api declaration, one for getting and the other for setting. The difference is use of ByVal (for setting) versus ByRef (for Getting) for the third parameter.
My solution was purely a trial an error effort I came to after googling and reading enough articles. I wish there was some documentation of the do's and dont's of API calling.
Without giving you my entire code base, if anyone else has experience owner drawing issues where this setting effected your code I would like to hear about your short comings and thus your work arounds and solutions to your issues.
0 4010 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Loreen |
last post by:
I have been going through user groups and forums for the past 3 hours
trying to figure out how to add "all" to my combo boxes.
I've got two unbound comboboxes. Once only has one field "FiscalYear"
and the other had two "DonationTypeID" and "DonationType". Both
comboboxes have Table/Query as the control RowSourceType and I setup
the...
|
by: Niranjan |
last post by:
I have a relatively straight forward report. The query that populates
data for this report is complicated. The report opens without any
problem and I can print it as well.
However, If I have another form open (has about 12 combo boxes) and
then I run the report, it appears on the screen, no problem. When I
print the report, I get 'Cant open...
|
by: Jeff_F |
last post by:
Hi all. Question in two parts. I'm looking to add two combo boxes.
The first will contain regions and the second will contain employee
names which correspond to the region selected in the first combo box.
What is the most efficent way to go about this type of layout - in
terms of code and populating the combo box??? thx.
|
by: sara |
last post by:
Hi
I'm pretty new to Access here (using Access 2000), and appreciate the
help and instruction.
I gave myself 2.5 hours to research online and help and try to get this
one, and I am not getting it.
Simple database: I want to have a user enter Supply Orders (just for
tracking purposes) by Item. The user may also enter a new item - "new"...
|
by: Joanne |
last post by:
I have searched through previous threads regarding this error. I went
back through all my code to make sure I closed and set to nothing all
open db's and rs's. However, I still have one computer getting this
error. This problem does not occur with any other users - some of whom
use the database continuously.
The user logs in, then goes...
| |
by: Zwoker |
last post by:
Hi Everyone,
I have a query that uses criteria from combo boxes in the form that runs it.
When I had only discrete values in the combo boxes that matched the data that was being queried, the result was great. I was getting only the records that I wanted.
As soon as I added "ALL" to the form's combo item lists I ran into trouble.
...
|
by: vincehallam |
last post by:
Hi newby here sorry if this sounds bread and butter stuff.
Using MS Access 2003
On a Form I want two Combo boxes which are getting their data from a table. The Combo boxes are A "Price 1" & B "If Bank Holiday Price Two". Is it possible to have "Price 1" visible as default but then if I tick a check box to have "If Bank Holiday Price Two" pop...
|
by: mistyblu |
last post by:
I wrote an Access97 application using VBA for a company many moons ago and they have approximately 20 users. All has been hunky dory for a long time but suddenly they have a combo box error on 3 of the pc's. The identical application works fine on the other 17 pc's.
The O/S is Windows XP Pro service pack 2.
There are several combo boxes on...
|
by: scubak1w1 |
last post by:
Hello,
Did a search here, manuals and Googled, etc generally, so apologies if I did not find the answer to my issue - that is, I try and 'self help' as mush as I can...
I adjusted my postgresql.conf file to set as on 'explain_pretty_print'
Now in pgAdmin (1.10.0) when I right-click a database in the 'usual' way, Maintenance, any of the...
|
by: Daniel Yantis |
last post by:
Combo Box 1 Displays a query/list with 2 columns:
SELECT Classes.CLASS_DESC, Judges.Judge, * FROM Classes;
Combo Box 2 Displays a query/list:
SELECT Judges.Judge FROM Judges;
I want Combo Box 2 to change based on Combo Box 1 answer. Combo Box 2 will still be editable but its default will be based on Combo Box 1.
Example:
I have...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
| |
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |