|
Does anybody know how to correctly use the GetUserObjectInformation in VB.Net. I seem to have many problems trying to get it to work. Here is what I am basically trying to do. I want to get the current desktop name. So in order to do so I have to call GetThreadDesktop(GetCurrentThreadId()). Which would go into the handle part of the GetUserObjectInformation call. But for some reason with everything filled in I get an error 0. I have seen this done many times in C++ and C# but have not found any reference in VB.Net.
Thanks,
Jason
|
|
|
|
|
|
Is your API declare like this?:
Private Declare Function GetSystemMenu Lib "user32" _<br />
(ByVal hWnd As Long, _<br />
ByVal bRevert As Long) As Long
Eric Dahlvang-Programmer
|
|
|
|
|
Ah! The declare had hwnd as an integer. I used Long like you said and it works great now!
thanks,
sb
|
|
|
|
|
The correct declaration should be:
Private Declare Function GetSystemMenu Lib "user32" _
(ByVal hWnd As IntPtr, ByVal bRevert As Integer) As IntPtr
Handles should always be declared IntPtrs because, just like handles, they're going to be the width of the processor, 32-bit on 32-bit procs and 64-bits wide on 64-bit procs.
The declaration you used, using Long , is a VB6 declaration. In VB6, Long are 32-bit signed integers. In VB.NET, they're 64-bit signed integers. The two representations are NOT compatible with each other!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Good Point
(pun intended)
Eric Dahlvang-Programmer
|
|
|
|
|
hellow to all
i am using Crystal Reports , to view and prints reports ..
i wanna generate a report from SQL Statement automatically , with out going throw the wizard and building column column ,
i wanna take an sql statement with various parameters and show the data in a crystal report ...
how can i build it ?
thxx for any help ..
|
|
|
|
|
Hi all,
I'd like to convert an integer to a formatted string that would be filled with "0" until a certain numbers of characters. For example: if the integer value is 10 and the formatted string has to have a length of 6 characters then the final string it would be "000010". Is there any VB6 function to do that?
Thanks in advance,
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
Format$(10,"0000000")
Eric Dahlvang-Programmer
|
|
|
|
|
Thanks a lot !!
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
How can I call a word macro when the document is loaded? (I cannot save it in the document)
I tried with command line param but then it tried to run the macro before the document is loaded. Also saved it in the normal.dot template but I don't have a trigger to call it
Dani
|
|
|
|
|
In Word help you will find
Run a macro
On the Tools menu, point to Macro, and then click Macros.
In the Macro name box, click the name of the macro you want to run.
If the macro doesn't appear in the list, select a different document, template, or list in the Macros in box.
Click Run.
But I like to add a button to the toolbar and have it run the macro:
Add a button to a toolbar
Show the toolbar you want to add a button to.
On the Tools menu, click Customize, and then click the Commands tab.
In the Categories box, click a category for the command you want the button to perform.
Drag the command or macro you want from the Commands box to the displayed toolbar.
If you don't see the command you want under a particular category, click All Commands in the Categories box.
Tip To quickly add a built-in button to a built-in toolbar, click More Buttons on a docked toolbar, (or click the arrow in the upper-left corner of a floating toolbar), click Add or Remove Buttons and then select the check box next to the button you want to add.
Eric Dahlvang-Programmer
|
|
|
|
|
I am afraid this isn't the exact solution. THe thing is, I need to embed this in my application so that it is transparent for the user (from an intranet web application I launch word through havascript to open a dynamic XML from a web service and an XSL to build the document - HTML). I don't want the user to interact at all (needs to be fully automatic) and it needs to be triggered right after the document loads.
|
|
|
|
|
hi there,
i have a problem in adding backgroundimage to listbox control in vb.net.
how can i add a backgroundimage to a listbox control.
i tried with following code. but its not the right solution to my problem.
i want to add a backgroundimage to listbox and also it should not be highlighted when i select any item in listbox.
" Dim g As Graphics
Dim font As Font = New Font("Verdana", 20, FontStyle.Bold,GraphicsUnit.Pixel)
Dim WBrush As New SolidBrush(Me.BackColor)
listbox1.CreateGraphics.DrawString("CONFLICT", font, WBrush, 0, 200)
please can anyone find the solution to this problem.
i will be very thankful if anyone can find a solution to this problem
thanks in advance.
nagaraju
|
|
|
|
|
You should go with protected overwrites of paint and use drawimage statement for background picture.
|
|
|
|
|
can u give few lines of code to draw any image on listbox as a hint
i didn't get ur words exactly.
the problem is when add code to drawstring its getting highlighted when i select any item in the listbox
hope u understand.
thanks for ur interest
kondepudi
-- modified at 6:57 Tuesday 31st January, 2006
|
|
|
|
|
hi there,
i have a problem in adding backgroundimage to listbox control in vb.net.
how can i add a backgroundimage to a listbox control.
i tried with following code. but its not the right solution to my problem.
i want to add a backgroundimage to listbox and also it should not be highlighted when i select any item in listbox.
" Dim g As Graphics
Dim font As Font = New Font("Verdana", 20, FontStyle.Bold,GraphicsUnit.Pixel)
Dim WBrush As New SolidBrush(Me.BackColor)
listbox1.CreateGraphics.DrawString("CONFLICT", font, WBrush, 0, 200)
i will be very thankful if anyone can find a solution to this problem
thanks in advance.
nagaraju
|
|
|
|
|
Hi
I want to display a control(ListView) inside the datagrid view
So the problem I encounter r:
1.How to get the Top & Left of the cell underneath I want to display that List View
2. If I add that List View with
me.datagridview1.controls.add(Lisview)
Listview.setBounds(hti.ColumnX,Hti.RowY,100,100)
But this is also not suceeded Properly
Then the control at the last or last to last row Cuts
As the ListView does not get the proper Space to occupy
Should I add that control to form Rather than DataGridView
But then how to Show the list view correspondingly with Datagridview cells (Like every cell in the Column2 has a image Clik on that iamge will show LisView underneath that cell)
Thanks For this Help
Hema Chaudhry
|
|
|
|
|
Hello!
I don't know how I can make an entry in to WAB (Windows Address Book) and how I could check if the entry I am intending to make is already exist or not.
I am seeking Vb.NET code samples about WAB and It has been for days I haven't found any.
If you help me to work it out, I would really appreciate it!
Thanks!
Bedri
|
|
|
|
|
|
Thanks Jason!
Kwab is not a solution for me. I need to have the full source code in VB.net. There are some written in C++ but I do not have any knowledge about C++ language.
If youcome cross it to somewhere would you please let me know because it has been over 5 days I couldn't find a sample code of it in VB.net
The life is an unknown cirle and we are the dot in it!
|
|
|
|
|
Hello
Eery one know the Address Bar for the internet explorer, it's like a combobox but with additional features(if the address is writen before, it shows you down,the scrollbar didn't appear only if the choice is more than 5), so how can i do the sam in VB.Net 2003.
With my best regard;)
Assaf
|
|
|
|
|
Not sure if this is what you're after, but this[^] is a good article on shell autocompletion (its C#, but a class library, so shouldn't matter). Maybe that will help.
Cheers,
Will H
|
|
|
|
|
I'm using the DataAdapter & the DataSet without using the wizard, but the problem that occured with me that i can't display the content of the Database in the appropriate textbox and combobox.
knowing that i verify if the connection is well established and the dataset contain the right data.
with my best regard;)
Assaf
|
|
|
|
|
Hey, If you are using the dataset then you can access individual field of the dataset using the row and column no. Please explain that exact problem that you are having.
With Best Regards,
Mayur
|
|
|
|