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 4017 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 RowSource through the query wizard interface.
Using the instructions I found at...
|
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 any more databases' error.
I am using OpenQuery method to run some queries before opening the...
|
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"
is a combination of Item, PartNumber and Vendor - they could have the
|
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 to the Add Invoice form - it's a fairly
simple form, single table recordset with a subform based on...
| |
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.
Firstly how do I make the query realise that I want every record, not just those that match the literal...
|
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 up and the values in B be used when clicked instead of "A".
Hope this makes sense ?
Regards...
|
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 a form which allow the user to find records based on the values selected. When the user types a...
|
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 tasks, its starts OK, but I get a dialogue box up every (seeming) operation that the Maintenance is...
|
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 250 Classes and 6 Judges. The number of juges will change from time to time and can be as many as 30....
|
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |