
Meanie
Members-
Posts
23 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Meanie
-
How can I get my screen saver to run a preview? I've written a screen saver using VB.Net and it is all set up to run a preview using the /p argument. Now I just need a little help to actually display the screen saver in the preview pane.
-
I want to create an array in a function using an integer that I pass. The compiler requires that I use a contant value, so I am trying to use the following: void WriteData(const int count) { int levelArray[count]; } What happens is the compiler gives me an error and tells me that count isnt a constant. However, when I try this: void WriteData() { const int count = 5; int levelArray[count]; } it compiles fine. Can someone tell me what I'm doing wrong?
-
Thanks, that works. Though I still don't get why my old code decided to stop working (both versions of it)
-
Okay, so this is meant to help multiple threads share resources, right? It doesn't really help my situation because I can't even get one thread running thanks to my compile error. ADDITIONAL: I loaded up an earlier version of my code, ran it once, and got the exact same error as the newer version. And this was *working* code. I think a windows setting got changed or something as I was writing the update to my code, because I know my computer was having a few fits when I did a compile once.
-
The following is the code I use to prevent multiple instances of my app. Its the same code I used from a previous thread on this forum Public Class Initialise Shared Sub Main() ' Prevent Multiple Instances of the Application Dim appProcesses As Process() appProcesses = Process.GetProcessesByName(Diagnostics.Process.GetCurrentProcess.ProcessName) If appProcesses.Length > 1 Then Application.Exit() Else Dim formMain = New frmMain() Application.Run(formMain) End If End Sub End Class Now the thing is, this all used to work up until last night. Now whenever I compile my app I get the following error message An unhandled exception of type 'System.InvalidOperationException' occurred in system.dll Additional information: Process performance counter is disabled, so the requested operation cannot be performed. This refers to this line appProcesses = Process.GetProcessesByName(Diagnostics.Process.GetCurrentProcess.ProcessName) Now I don't recall disabling the process performance counter, or whatever it is. Any ideas on how to fix this?
-
Nah, I didn't. The info i did find didn't seem to relate to VB .NET, so I'm hoping someone else will be able to help out here. I'll keep u posted if I do find out.
-
True Though what I don't get is why you need to install the installer just to install the program? Shouldn't the whole thing be self-extracting anway? And why generate an INI file? If the Setup app can find the INI file, couldn't it just find the MSI file and any other installer-required files by itself? I still don't have a complete understanding of Windows Installer, especially whole bootstrap thing, but the only installer I need is one that suits my purposes. And at the moment Inno does the job just fine.
-
Yeah, bpayne111, thats what I'm after, but don't worry about it because you've actually managed to inspire me. I realised the easiest way to retrieve the startup dir was to get it the same way I retrieve the current user's username Then I realised that was what divil wrote. Sorry, I wasn't paying attention :D I should now be able to figure it out from now, thouh if I have any more problems I'll be sure to ask
-
Inno Setup. My first attempt and writing an installer for my app with Inno worked out so much better than the hour or so I spent trying to figure out the Windows Installer. Not that I'm bagging the Windows Installer, it seems pretty powerful. But I wasn't exactly happy with the fact that it generate 5 different files that need to be distributed together just to ensure compatibility with everyone's system (InstMsiA.exe, IstMsiW.exe, Setup.exe, Setup.ini, and the .msi file). The overall size was just too big to distribute (3.56 mb) when Inno gave me a simple 330kb file that did everything Windows Installer did (and was a *hell* of a lot faster at doing it too)
-
Never mind, found a better installer to use
-
How can I get Windows to acknowledge that I have changed the desktop background color so that it can refresh the display, just as it does in the Desktop Properties? I've made the color change through the registry.
-
:p Hehe, I got the registry sorted out, it's just the shortcut that I want.
-
When installing my app with the Windows Installer, how can I set a registry key to have the value of the install path as specified by the user?
-
NotifyIcon components are used when the program is running. I have one set in the system tray when my app is running, and it disappears when the app shuts down. Without the app running it doesn't really do much. No, what I need is to set a shortcut to start the app on boot without the shortcut affecting other users of the same computer.
-
I currently have my program loading when my computer boots into windows by setting the path in my registry, but what I want to do is to have an actual shortcut placed in the Startup directory of the Start Bar. The program has to be able to add and remove this shortcut whenever the user decides to enable or disable the option to start at boot through the program. Also, the shortcut must only be set to the current user, not all users, since the program allows for multiple users and multiple settings. Any ideas?
-
Moved, eh? Hehe, I posted in General because I thought I was posting a maths question :D Anway, thank, that worked. Now I feel real silly for not realising this at first because I have been using the same sized rectangle for other parts of the code. Oh well, we learn, eh?
-
I'm scaling a wallpaper image down into a display area of 152x114 and noticed an image's resolution affects the actual scaling of the image. For instance, an image 1024x768 with a resolution of 96x96 scales down fine, but a same sized image with a resolution of 72x72 is clipped, with only a portion of the image appearing in the display area. My maths is a little rusty on the subject, but i've managed to factor in the resolution of an image, but the outcome results with the image now slightly smaller than the display area, resulting in grey lines appearin on the bottom and on the right of the image. Here's my code: giXLen = 152 giYLen = 114 xImgLen = img.Width / (img.HorizontalResolution / 100) yImgLen = img.Height / (img.VerticalResolution / 100) dXratio = giXLen / xImgLen dYratio = giYLen / yImgLen ' Scale image G.ScaleTransform(dXratio, dYratio) G.DrawImage(img, pOffset) What else am I supposed to take into account in determining the actual image size so I can find the proper scaling ratio?
-
Hi, another question about setting wallpaper. I've been using SystemParametersInfo to set wallpaper and have had success with that, but it only sets BMP's and I want it to be able to set JPG's and other image types. The API IActiveDesktop that can solve this, but I don't really know how to how to access it in VB. Any suggestions?
-
:p Cheers man, that worked
-
Thanx for the help, but the code really doesn't do much if the mouse is moved before the textbox is made blank or if the user TABs between the controls instead of using the mouse.
-
How can I go about updating a textbox when the focus on this textbox is lost? For instance, if the user clears the textbox, I want the default value to be entered when the user clicks away.
-
Cheers man, that worked.
-
Problems setting wallpaper Hi, I've been writing a program to change the wallpaper, but it just won't work Here's the code I've been using to set new wallpaper Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As String, ByVal fuWinIni As Long) As Long Const SPI_SETDESKWALLPAPER = 20 Const SPIF_UPDATEINIFILE = &H1 Const SPIF_SENDWININICHANGE = &H2 Private Sub SetWallpaper() Dim lReturnVal as Long lReturnVal = SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, "C:\Temp\Test.bmp", SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE) End Sub When SetWallpaper() is called (at a press of a button, atm), the whole desktop flickers but the wallpaper doesn't change, and no amount of refreshing will help. Also, lReturnVal returns a non-zero character, and that means success (right?) so its obviously working, except it isn't. Is there is anything I'm missing?