How Can My VB Application Know The System State?
I want my application to know that whether the my System is currently Locked or Unlocked on Windows XP. As we lock our System by pressing CTRL + ALT + DEL and then pressing Lock Computer. How can my application know that whether my system is in locked state or not?. What API i need to call to know this?.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Backup And Restore Of System State
Hello,
I want to programmatically perform a System state Backup & Restore. This should be running silently without the knowledge of user.
If any one has worked on this, i would like to know about the same. it would be nice if the code is pasted here.
Thanks
Free Class: Get/Set Internet System State
Surfing makes health better, part 2/xxx:
http://www.vbip.com/wininet/wininet_connection_01.asp
..to excuse the subject of my thread
or
http://www.vbip.com
..to stop having VB internet-based questions anymore
POll SYstem State To See If Windows Is Shutting DOwn??
Does anyone know how to get this information? I need to be able to check for the system status in case the user attempts to shutdown the computer during a data transfer. Any ideas would be appreciated!
Thanks!
Wiley
Application Freezes Or In Hang State
Hi guys
How can i detect if an application is in hang state or the application freezes?
I have this code below to check in my application checker. It checks if an application is in hang state and it closes the application if it is. But for a reason it does not close an application if it is in hang state.
Abort Hang Statement Code:
lReturn = SendMessageTimeout(lHwnd, WM_NULL, 0&, 0&, SMTO_ABORTIFHUNG And SMTO_BLOCK, 60000, lResult)
For i = 1 To lvAppList.ListItems.Count
lHwnd = lvAppList.ListItems.Item(i).SubItems(4)
lPid = lvAppList.ListItems.Item(i).SubItems(1)
If lHwnd <> 0 Then
lReturn = SendMessageTimeout(lHwnd, WM_NULL, 0&, 0&, SMTO_ABORTIFHUNG And SMTO_BLOCK, 60000, lResult)
If lReturn Then
Label5.ForeColor = vbBlue
Else
msgbox "Application Freezes"
lvAppList.ListItems.Item(i).SubItems(4) = lHwnd
lvAppList.ListItems.Item(i).SubItems(1) = lPid
End If
End If
Next
Thanks and God bless
FileCopy Method And Application State?
hello vbCity!
I have 2 questions. Are we allowed to post 2 in one post?
I am using fso file.copy to copy a file from cd to hard drive(very slow). I want to use vb's filecopy function but I am getting an error (runtime '76', path not found) I believe because my file is read-only. Here's my code:
Code:
For Each CDFile In CDFiles
FileExists = InStr(1, UCase(CDFile.Name), ".MDB")
If FileExists <> 0 Or FileExists <> Null Then
SourcePath = CDDrive.Path & "" & CDFile.Name
'Instantiate the file object
Set CDFile = FSO.GetFile(SourcePath)
DestPath = App.Path & ""
'Copy the file
' SetAttr SourcePath, vbNormal
' FileCopy SourcePath, DestPath-----------------This method is faster-------------
CDFile.Copy DestPath, True
'Change temp file attribute from readonly to normal
SetAttr DestPath & CDFile.Name, vbNormal
'I'll do something else here.
'Delete the temp file
Kill DestPath & CDFile.Name
Exit For
End If
Do you think that the Read-Only is what is giving me the error using filecopy? This works fine using the fso file.copy.
Any solutions?
Here's my second question:
How can I find out if my app is in the copying process so I can display a progress bar to my user. This way they can see that the app is doing something.
While app is copying the file
show progress bar and fill it up
wend
Something like that or close I think....
Thanks VB City!!!
Preserving The State Of ToolBar For MDI Application
Hi friends
in my project 4-simple forms and 1 mdi and 1 comman toolbar on MDI form for Operation Like Save, Add,Delete and Modify. so i want to Preserve the state of ToolBar when i goto the another forms without closing first form. understood...please help me
State Management In A Windows VB 6.0 Application
Hey folks.... do you know of any state management techniques in VB 6.0, for example if you wanna keep the state of the controls around after saving the forms and have all the differnent forms in my application access the new state...what's the best way to do that...If you can tell me about a couple of ways to manage state, that would be great. I'm a web programmer so never really dealt with state issues on a windows VB 6.0 application.
Thanks
Infinity
Setting The Application's Exit State
hi!
is there a possibility to set the exit state for my application in VB, such as by returning a value from a C application's main method?
thanx for any help!
Activex Control Active State To Inacitve State Transition
Hi all,
I have an activex control ,that i put in power point .When I
come out of the slide show i want to store the state of the controls state .How do I know when the control transists from ACTIVE STATE TO INACTIVE STATE.
ajit
Capslock State And Shift State Is It On Or Off
Is there any simple code to get the state of the capslock and shift keys. Basically I want to know if when a letter on the keyboard is pushed what case will it be in (upper or lower case) becasue this can be achieved by either the capslock key or the shift keys I need code to determin what state the capslock is set to and whether either of the shift keys are depressed. Unless there is a simpler bit of code that will tell me whether im typing in upper or lower case.
Any help would be great
Thanks
SC
Put My Application On Win. System Try
I would like to put my application in windows system try. but i don't know how?
my objective is:
Design a windows based application with VB ver 6.0 that will run at some difrent time's i will made a timer to check the time and when application will running but i need to put this application on sys. try. to let it ready.
i have other solution but it's not a good solution
that's set this application not appear on task bar.
Thank's
Autostart An Application With System
Hello there,
does anyone know how to register an application in a way that it starts automatically with the system?
I want to write something like a reminder, which starts with windows xp prof. and reminds me periodically about tasks.
Thanks alot beforehand
jotefpe
Monitoring Application Use On System
Hi Guys,
I want to build a program that runs in the background unseen and generates a log file of what applications were run, what time they were run and what time they were shut down etc. Is there some way to do this?
How To Run An Application As System Service
hi.. i am making an application whick is to be run as the a system service(eg..as soon as the system boots the application should start automatically and whn it shutes doenit should closed)...
any idea about it......
Application In The System Tray...
Hi, I was wondering if anyone knew how to make an app that appears soley in the system tray. I am sure this question has been asked umpteen times before. But I can't be bothered to look.
Anyway, any help would be greatly appreciated. Cheers.
HTML Help System And VB Application
I have made a HTML help system for my VB application. When I press F1, in my application, the help window opens and everything is fine.
But...
I want to have popup help window for each field (text control) in the form. Following instructions I made [MAP] and [TEXT POPUPS] sections.
When the text control has the focus, after I press F1, I have an error window with message: "HH_HELP_CONTEXT called without a [MAP] section".
What is the problem?
Thank you for any help.
Running VB Application On System Without VB?
All of my VB applications have been done for fun and for my own use. I compile & run them from the Visual Studio environment.
Some friends of mine have seen a few of my applicatons and would like to run them on their systems.
I have never atempted to Package an application for use on another system. Will the Package & Deployment Wizard do a good job? I am going to try to hack the Wizard first and then look at the MSDN Help Files I have.
Any hints at how to get started would be appreciated.
What if the Target system runs Windows 95, XP, 2K, or another OS instead of Windows 98 SE (My OS).? Will there be problems?
What about different Video controllers? I assume that this will not be a problem. Will running at a different resolution or color mode cause a problem? I intend to experiment a bit with this on my system, but would welcome advice.
If I experiment on my system in the Visual Studio environment and the applicaiton seems to work okay, will this indicate that the deployed application will also work okay with changes in screen resolution & color mode?
I hope at least some of the above can be answered, and I will appreciate any advice I can get. I like to hack, but do not really want to reinvent the wheel.
How To Hide Application From System
I've seen this information before in these forums...
Specifically, How do I hide a VB app from the system so it does not show up on CTRL ALT DEL shutdown menu or the taskbar?
Application Patch System
Does anyone know of a script in VB6 that would update my applications? Example: Lets say I have Client A in Seattle WA, and I am in Not Seattle WA. I write an update to the software and want to push it out to Client A without physically going to Client A's place of business and copying over the exe file. I know it can be done, but I am lacking the understanding. Can anyone shed some light?
Thanks
Matt
How Do I Set System Colours Per VB Application
I want to set the system colours for different VB applications (linked to an Access.mdb).
I have been told that I could set them and reset them using API calls has anyone got code to do this they wish to share?(or advice).
(This is the only way I can be sure that a custom colour scheme won't clash with the users systems settings- any help would be gratefully appreciated.
Dll In System And In Application Folder?
Hi,
Anyone knows where can I read about how Windows (as many versions as possible... NT; 2000; etc) deals with system dlls?
I think that windows95 searches for them in the application directory and if this directory doesn´t have the dll it will use that in system directory...
I would like to have sure about this topic.
Thank you
Sérgio Oliveira
Run Application On System Event
hi friends
i want run my application on system event like Particular time arrives on system clock etc.. window events like opening file or folder .... so i want this type of application that directly works on window events. please send me suggestion.
How To Put An Application To System Tray
hi,
well... i want to know how to hide an application and put it to the system tray, also at the same time the program should run (i.e., the tasks in a timer in the application)
i hope that u guys can help me in this
Thanking you in advance...
adhu
System Tray Application
Dear Friends
I developed an application to Appeare on System Tray. THis is continuasly running.
I used Timer Control and "Shell_NotifyIcon" API in that application. Peogram is work fine.
I am using windows 2000.
Problem is I cant shut down windows since the above program is running.
Please can any body help me.
VB6 Application From System Tray
Hello
Can any one tell me how we can make a VB6 application to run from the system tray?
From system tray the user can invoke the application at any time.
Thanks & Regards
Ananda
System Modal Application?
Platform: VB6 (SP5)/Win2K (SP3)
Hi
I am trying to develop a tool which will be a dialog based application in VB, very small in size.
I want that to appear as system modal so that it appears above all active windows.
How do I do that?
Thanks
Manish
Application Locking System
does the api setwindowpos when called from your apllication set you form on top of all others , so no one can access nothing on your machine,except my application . if not is there an api that can do that on win9x/win3.5 and later.
thanx in advance .
george
System And Application Variables
I would like to remove the hard-coded paths I have in my database code. Does VB have system variables that allow me to retrieve the computers node name and other information about the network?
How To Know An Application Is Installed In System ?
My application needs some registry values of installed applications......
How to find an application ( ex: MS Word/ MS Excel/ MS Access...ect) is installed in a system or not through code................
Thanks in advance......
System Menu In VB6 Application
Hello,
I have developed a skinnable GUI application which requires form with BorderStyle=None, ClipControls=False and ControlBox = false, this disables the system menu of application. I am using SetWindowsLong Win32 API to force system menu,
SetWindowLong Me.hWnd, GWL_STYLE, WS_SYSMENU Or WS_MINIMIZEBOX
However, when I press Alt+F4 or try to close application with system menu, application doesnt respond to action. Note that "Close" menu item is enabled in system menu. Any idea, how can I resolve this issue ?
Thanks,
Danish
Showing Application On System Tray
how will i make a visual basic program run on the system tray automatically when the system is up .i want to develop a program that runs and popup a message when the system is on.this is similar to what we have in anti virus programs that run as a service in the system tray when the system is up.
hope someone will assist soon.
Thanks
System Tray Application Problems
Hi,
I am working on a programme, and I have been asked to make it a background application, i.e. when minimised, it runs in the taskbar.
I have used microsoft's solution:
http://support.microsoft.com/kb/176085/EN-US/
The programme runs, and it can be minimised to the system tray.
Unfortunately, the
nid.uCallBackMessage = WM_MOUSEMOVE (where WM_MOUSEMOVE = &H200) does not seem to operate correctly in this application. This in turn causes the failure of the Form_MouseMove sub to be called - the application cannot be re-maximised from the system tray once it has been minimised there.
I tried Microsoft's code in a completely new application, and it worked fine.
What I would like to know is, what could be causing the programme to ignore this command, and how can I overcome this - is this a known issue?
Minimize Application To The System Tray
hi, i want to minimize my application to the system tray, how do i do that? i want it running all the time so i can't close / unload it....
Added [RESOLVED] to thread title and green "resolved" checkmark - Hack
Load Application On System Start-Up
Hi,
I have a bit of a problem at the minute and was kind of hoping anyone could help me. I'm trying to find away to allow my app to load on system start-up. So when windows loads my application will also load as well. How would i do this? if anyone has a shell program that would help but i would also like it explained a little bit too. Just to help me understand it a little bit better.
Thanks
Minimizing An Application To The System Tray
I have this module for creating an icon in the system tray for my application:
Quote:
Option Explicit
Type NOTIFYICONDATA
cbSize As Long
hWnd As Long
uId As Long
uFlags As Long
uCallBackMessage As Long
hIcon As Long
szTip As String * 64
End Type
'The following constants are the messages sent to the
'Shell_NotifyIcon function to add, modify, or delete an icon
'from the taskbar status area.
Const NIM_ADD = &H0
Const NIM_MODIFY = &H1
Const NIM_DELETE = &H2
'The following constant is the message sent when a mouse event
'occurs within the rectangular boundaries of the icon in the
'taskbar status area.
Const WM_MOUSEMOVE = &H200
'The following constants are the flags that indicate the valid
'members of the NOTIFYICONDATA data type.
Const NIF_MESSAGE = &H1
Const NIF_ICON = &H2
Const NIF_TIP = &H4
'The following constants are used to determine the mouse input
'on the the icon in the taskbar status area.
'Left-click constants.
Const WM_LBUTTONDBLCLK = &H203 'Double-click
Const WM_LBUTTONDOWN = &H201 'Button down
Const WM_LBUTTONUP = &H202 'Button up
'Right-click constants.
Const WM_RBUTTONDBLCLK = &H206 'Double-click
Const WM_RBUTTONDOWN = &H204 'Button down
Const WM_RBUTTONUP = &H205 'Button up
'Declare the API function call.
Declare Function Shell_NotifyIcon Lib "shell32" Alias _
"Shell_NotifyIconA" (ByVal dwMessage As Long, _
pnid As NOTIFYICONDATA) As Boolean
'Dimension a variable as the user-defined data type.
Dim nid As NOTIFYICONDATA
Public Sub AddTrayIcon(hWnd As Long, hIcon As Long, sTTText As String)
'As the name indicates, this Sub adds an icon to the System Teay.
'Parameters- hWnd: Handle to the form the icon is attached to,
' normally the main form of the application.
' hIcon: Handle to the icon to display. This can
' be the Icon property of a form, or the Picture
' property of an Image control or PictureBox.
' sTTText: The ToolTop text to display when the
' mouse hovers over the icon in the Tray.
nid.cbSize = Len(nid)
nid.hWnd = hWnd
nid.uId = vbNull
nid.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
nid.uCallBackMessage = WM_MOUSEMOVE
nid.hIcon = hIcon
nid.szTip = sTTText & vbNullChar
'Call the Shell_NotifyIcon function to add the icon to the taskbar
'status area.
Shell_NotifyIcon NIM_ADD, nid
End Sub
Public Sub RemoveTrayIcon()
'This Sub assumes the "nid" variable is still loaded with
'values from the AddTrayIcon Sub, which will ordinarily be true.
Shell_NotifyIcon NIM_DELETE, nid
End Sub
Public Sub TrayEvent(frmApp As Form, mnuPop As Menu, fXCoord As Single)
'In this example, we are only resonding to double-clicking
'the left button on the Tray Icon, or right-clicking it. If
'you want to respond to other mouse events (like right button
'double-clicks), put code in the relevant cases.
'Parameters- frmApp: A reference to the form calling this code.
' mnuPop: A reference to the PopUpMenu to display.
' fXCoord: The X parameter from the MouseMove event
' calling this code.
Dim lMsg As Long
lMsg = fXCoord / Screen.TwipsPerPixelX
Select Case lMsg
Case WM_LBUTTONDOWN
Case WM_LBUTTONUP
Case WM_LBUTTONDBLCLK 'Show the main form of the app on
frmApp.Show 'the left double-click event.
Case WM_RBUTTONDOWN 'Show the PopUp menu on the right
frmApp.PopupMenu mnuPop 'click event.
Case WM_RBUTTONUP
Case WM_RBUTTONDBLCLK
End Select
End Sub
Public Sub ChangeTrayIcon(hIcon As Long)
'This Sub changes the icon associated with the Tray Icon. It
'assumes the nid variable is still loaded from the AddTrayIcon Sub.
'Parameter - hIcon: Long handle to the icon to be used.
nid.hIcon = hIcon
Shell_NotifyIcon NIM_MODIFY, nid
End Sub
Adding this to the Form_Load event adds the icon into the tray:
Quote:
AddTrayIcon Me.hWnd, Me.Icon, Me.Caption
BUT, here is my problem. I am nearly sure this is the module I used when I added in code to minimize my application to the system tray icon so it's not on the taskbar, but I have forgotten the code. To clarify, I want to minimize my app to the system tray by clicking the minimize button on the form : _ [ ] X
Thanks all in advance.
Calling An Application Through A System Service
Is there a way to run application B.exe through A.exe, which is executed by a system service (NT/2000)? The problem is my call shell comand works on Win95/98/ME, but on NT and 2000, the service which kicks off A.exe does not have permission to spawn B.exe. Can you specify the permission in the code? Hope this makes sense.
How Do I Start An Application From Remote System???
dear friends,
Can u help me on this, i want to run an application which is installed on the remote system, I want that application to open on the parent system not on my system from where i'm invoking it. Is it possible???
regards
Latesh
Minimize Any Application To System Tray
Hi,
I am working on a program to minimize any program to the system tray. i.e. outlook...word or any program. Basically I want to remove the minimized application from the task bar and put an icon in the system tray. I know it can be done as I have seen other apps that do it...I am not sure of I need to capture the hWnd (I can capture it no problem based on the title bar text) just not sure how to send it to the tray.
Thank you in advance!
Paul Eric Norwood
Minimize Application To System Tray
How to minimize the application to system tray?
By the way, how to restore the application when user right click the icon on system tray and select restore....
Your kindness is highly appreciated.......
How To Run An Application Whenever System Connected To Internet?
Hi,
How outside application can know, whenver the system is connected to internet? The main thing is whenever the system is connected to internet, I want my applicaiton to do something. that means I need to run my applicaiton.Is there any way to do this except running a serivce in background and watching always? I dont want to run the service for this. Is there any way of hooking. I need to do this in VB6. Please help me in this regard.
thanking you
Regards
PraveenP
|