|
What happens if you create a new project and set the default form's background image to this image and run it?
|
|
|
|
|
I have tried making a new project, and it does exactly the same thing.
I'm beginning to think that it's a bug in the software.
Brian Hull
|
|
|
|
|
Not one I can replicate.
How about with a different image of the exact same size and color depth? What are those numbers anyway?
Is this a multi-frame image?
|
|
|
|
|
I have tried this with different images of the same size and different size, but it always does it.
Sorry but i don't know what a multi frame image is.
I could always email you the screen grab and the original file for you to take a look at?
Brian Hull
|
|
|
|
|
Brizee wrote: Sorry but i don't know what a multi frame image is.
You've seen animaed GIFs, right? That's a multiple frame image. Each step in the animation is a seperate frame. Multiple full-frame images in the same file.
Hmmm... I can't seem to duplicate the problem. BackgroundImage of the Form, right?
|
|
|
|
|
Sorry for being so dense.
It's not a multiple frame image no, just a BackgroundImage on the form, an index coloured png file at that, just to try and keep the file size down.
Basically i have made a card game and in the game you choose one of 5 options and depending on the option chosen dictates which backgroundimage is visible. It's basically to give it a nice GUI, instead of a plain colour.
I am starting to think that maybe the issue lies simple with my version of VB.Net.
Brian Hull
|
|
|
|
|
Brizee wrote: I am starting to think that maybe the issue lies simple with my version of VB.Net.
Don't count it. I can't duplicate the problem no matter what I do.
Are you doing any painting of the form or any controls yourself?
|
|
|
|
|
When i call it like this:
<br />
Public Delegate Function EnumFuncDeleg(ByVal hwnd As Long, ByVal lParam As System.Text.StringBuilder) As Long<br />
<br />
Declare Function EnumChildWindows Lib "user32" (ByVal hWndParent As Long, ByVal lpEnumFunc As EnumFuncDeleg, ByVal lParam As Long) As Long<br />
<br />
'<br />
'<br />
' Inside function<br />
EnumChildWindows(ProcessInfo.Handle, AddressOf EnumChildWindow, Nothing)<br />
I get an error saying that: System.AccessViolationException was unhandled
Message="An atempt was made to read protected memory, this often inditaces that memory is corrupt."
What could be wrong? It dosent mater what window i try to enum, i allways get the same results
All feedback is welcome
Thanks
|
|
|
|
|
Your delegate declaration is awry - the lParam parameter should be an Int32
Also - in VB.net a 32 bit number is not a Long - replace all instances of Long with Int32.
<br />
Public Delegate Function EnumFuncDeleg(ByVal hwnd As Int32, ByVal lParam As Int32) As int32<br />
<br />
Declare Function EnumChildWindows Lib "user32" (ByVal hWndParent As Int32, ByVal lpEnumFunc As EnumFuncDeleg, ByVal lParam As int32) As int32<br />
<br />
'<br />
'<br />
' Inside function<br />
EnumChildWindows(ProcessInfo.Handle, AddressOf EnumChildWindow, Nothing)
|
|
|
|
|
Thank you for that! It works lika clockwork now
|
|
|
|
|
Can anybody help me with a little nightmare that i'm having?
I am trying to make a countdown timer in VB.net showing years, months, hours, minutes and seconds, and i want it to tell me the time between two dates and then count down to that appointment.
I've tried playing with the date.interval class and have got myself in a mess.
Please help me.
Brizee
|
|
|
|
|
It would be easier to help, if you specify what kind of problem you are facing. Tell us what your doing with the code and what is the error or problem you are facing with the data.
You can use the Date.Timespan class to get the difference between two dates and use a timer control to do what you want.
|
|
|
|
|
Thanks for the information. I will try and utilise the Date.Timespan class instead of the Date.Interval class, and hopefully i will make some headway.
Many Thanks.
Brian Hull
|
|
|
|
|
You could display "Now" and then set the timer event to update the textbox/label and set the timer interval to 1000 milliseconds (1 second).
Here is a sample
Dim d As Date
Dim ts As TimeSpan
Private Sub TimerTick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
d = #12/25/2007#
ts = d.Subtract(Now)
Label1.Text = ts.ToString
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub
|
|
|
|
|
Hey thanks for your help, you've got me sorted and it works a treat. I can now start getting this implemented into my application.
Brian Hull
|
|
|
|
|
Could i ask another question which really is about syntax. What if i want to put a date and time into d, would that then be #12/25/2000/12.45#.
I'm presuming this isn't correct?
Brizee
|
|
|
|
|
Hi
I used CoCreateGuid window API in vb 6.0 application it works fine.
But for vb.net it makes problem, if anybody know please tell me how i used it in my vb.net code.
Thanks
Thanks
|
|
|
|
|
bony_baba wrote: But for vb.net it makes problem
Care to explain the problem or error you're getting?
bony_baba wrote: if anybody know please tell me how i used it in my vb.net code.
Show us your VB.NET code and we'll see what we can do to help you. We won't write it for you.
|
|
|
|
|
i Upgrade my vb 6.0 application to Vb 2005 it works fine in vb 6.0 but not in vb.nET.
Now the problem is solved actually it makes problem in passing structure without marshalling.
Thanks
Thanks
|
|
|
|
|
I'm glad it's working. From the samepl you provided from the conversion, you could have done all of this in one line of code if you rewrote it from scratch.
|
|
|
|
|
|
are you *sure* it's a COM dll ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
How to get all window handles knowing it's process name?
|
|
|
|
|
Use the Process class and it's GetProcessesByName method to get the Process object for it. There is a MainWindowHandle property in that object. You use that handle and the Win32 API function EnumChildWindows[^] to get all of the child window handles and add them to your list. You then have to use EnumChildWindows again on each of those returned handles to get the child windows of that list of child windows, again, adding the new handles to the same list you're maintaining. Rinse and Repeat until you get to the end of your handle list.
|
|
|
|
|
Thanks, works like a charm... But i've got another question. I am trying to use FindWindowEx function to get a handle of the control i need, but i do not have a class name for that control. enumerating is stupid, i'd like to hard code it. Is there a way to know the class name?
|
|
|
|