Visual C++ :: Windows Slideshow Screensaver
Apr 21, 2013I am looking windows slideshow screen saver source code.
View 5 RepliesI am looking windows slideshow screen saver source code.
View 5 RepliesI have a Windows service that may change the timeout of the logon screensaver in Windows (as described here.) To do that I change the following registry key to the timeout in seconds:
Code:
HKEY_USERS.DEFAULTControl PanelDesktopScreenSaveTimeOut
The issue is that how do I make OS "read" or refresh the actual screensaver timeout after a change in the registry key above?
My practice shows that it is refreshed (for sure) only when I reboot the system, but in my case I need it to be applied without the reboot.
How do i go around the code for this screensaver..
[URL] .....
I tried some examples from other people's code but it doesn't seem to work. Tried to ask the owner aswell but it doesn't seem that he would be able to reply as he's been inactive.
I've just integrated the Windows SDK V7.0A into my VS2005 application, and I'm getting the dreaded "Application configuration error" when I try to run it on an XP machine.
It runs fine on the development machine, and some customer machines (Win7 and Win8), but will not run on XP due to missing/incorrect version dlls.
I've rebuilt all my libraries, but still no joy.
So, my first question is - If I upgrade the Windows SDK to V7.0A, do I also need to use MFC 10 and msvcrt10, or can I stick with MFC 8?
The next question is, how do I find out which dlls are missing, and which libraries or other dlls are requesting the missing versions?
In my application I have some type of windows showed in an instance of time, and an action shows a new one that i want have the focus all the time , in the way that i can't works with no one of the others. They all are windows, child windows an modeless dialogs, but i don't know how to do. I try use EnableWindow(FALSE) that all the others windows and dialogs, but not works.
View 2 Replies View RelatedI used to retrieve IP and NIC information by querying windows registry. Now I'm trying to use GetAdapterAddresses() API. Using GetAdapterAddresses() to get IP is not that easy, I need to dig a long deep as I check some examples so far, anyways my question is: Calling this API will return success on all versions of Windows ie: 32bits & 64bits ?
Though Microsoft has not opened any source, where this API is actually retrieving Windows IP information.?. Is it reading Registry or some windows file.
I want to connect to an SQL Server database using ADO with VC++.
In order to do that you need to import an external dll, like so:
#import "C:Program Files (x86)Common FilesSystemadomsado15.dll"
What if the OS is not 64 bit? That would mean the (x86)-suffix would be incorrect.
how to work around this using certain preprocessor directives?
Something like this, maybe?:
#if 64bit
#import "C:Program Files (x86)Common FilesSystemadomsado15.dll"
#else
#import "C:Program FilesCommon FilesSystemadomsado15.dll"
#endif
My goal is to know if Windows is installed on an active disk partition.
View 8 Replies View RelatedI am new in Visual C++ and I have to make an MFC application with "child" windows. Here is what i need to achieve - [URL] ..... As you can observe when you click on the cross of popup window or child window 2 both are closing.
View 2 Replies View RelatedI designed an app for work that lets you enter data in a much more efficient way, then it needs to paste this data into the very curmudgeonly interface we use for work. I designed this app a long time ago while at a different company, and I used VC++ 6. I'm still using VC++ 6, but in a vbox with windows XP.
The code is being called as part of a bigger function that determines what exactly needs to be pasted into the work app spreadsheet. I have to call each item separately because the work app does not take copied tabs the way Excel would or whatever, it just ignores them. And it also pops up boxes and such that need to be handled in other ways.
The result works just fine under Windows XP, but when I do it under my regular Win7 box or on the Win7 boxes at work, it does not work properly.
This sets the data up, Text being the data to be pasted:
Code:
while (1) {
if (OpenClipboard() == FALSE) {
::Sleep(1);
continue;
}
HGLOBAL clipbuffer;
char * buffer;
EmptyClipboard();
[Code] ....
No infinite loops yet, again was just testing if it was OpenClipboard failing because it was being called again too quickly or something (and it did happen occasionally).
Then testing that the clipboard data is correct (this is always true), and pasting with keybd_event. SendInput is not available with VC++ 6.
Code:
HGLOBAL hglb;
LPTSTR lptstr;
LPTSTR buf = Text.GetBuffer(0);
while (OpenClipboard() == FALSE)
::Sleep(1);
[Code] .....
If the ::Sleeps are commented out, it will paste the wrong data almost every time under win7. It seems like it pretty much uses the last thing to be copied in the function and pastes it over and over (but not *always*). If I uncomment them, it will work as expected, but it obviously takes longer. With ::Sleep(50), it works about 80-90% of the time. Obviously I can't have the wrong data being pasted, and I'd prefer not to have to wait like this--and perhaps on a slower system or a system that is doing other things it may take longer and paste the wrong thing. It works fine on XP even without the sleeps.
Did keybd_event become a separate thread or something? Am I doing something wrong with the buffers? (I've tried using CSharedFile too with GMEM_MOVEABLE | GMEM_SHARE | GMEM_ZEROINIT settings, exact same thing.) Why does it work fine under XP but not under 7?
The following code it taken from msdn library but it is failing to compile.
the following code has a header where all the variables used here are stored in header App.h.
The following lines are giving trouble:
Code:
DialogBox(pApp->getInstance(), MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, pApp->About);
error: 'App::About': function call missing argument list; use '&App::About' to create a pointer to member
Code:
wcex.lpfnWndProc= &App::WndProc;
error: '=' : cannot convert from 'LRESULT (__stdcall App::* )(HWND,UINT,WPARAM,LPARAM)' to 'WNDPROC'
There is no context in which this conversion is possible
Here is the complete code:
#include "stdafx.h"
#include "App.h"
App::App(void) {
}
App::~App(void) {
[Code] .....
Is it possible to show a console window in a Win32 DLL?
View 3 Replies View RelatedI have struggled to send email from my MFC applications using severl methods:
1) http via my server - works but limited
2) M$ Outlook automation - works but not easily interchangeable between machines
3) Windows Sockets - available information simply too complicated
4) Purchase an ActiveX control - I hate black box solutions and am too cheap
I have looked at P. J. Naughter's class
CPJNSMTPConnection v2.99
An MFC class to encapsulate the SMTP protocol
[URL]
This approach requires the implementation of OpenSSL which turns out to be nothing short of a nightmare to install (so I never got it to run). I am looking for an example of an application that utilizes SMTP via Windows sockets api.
I have created an application to burn my data files into DVD. The problem which I am facing is as follows:
Suppose I have a folder "Doc_Files" present inside "D:Data" location for burning into DVD. The correct behaviour of the application is, after writing the "Doc_Files" folder into disc, I have to immediately delete this "Doc_Files" folder from the "D:Data" location.
I am calling the DeleteFile() Win32 API for deleting those files which are present inside "Doc_Files" folder.
The files are getting deleted successfully but they are still shown in the same folder untill I do not terminate the application.
Till the application is up those files are still visible even after they are deleted. And as soon as I kill my application and refresh my data folder those files are gone, and the folder becomes empty.
I am making use of IMAPI interfaces and methods for burning process.
I have a 32-bit application that I've been maintaining for about 12 years and it runs on every Windows platform up to Windows 7. In all that time I've been using CWinApp::GetProfileXxxx() and CWinApp::WriteProfileXxxx() calls to read and write my program settings (about 70 settings) in the Registry. The settings are read from the Registry at start-up and written to the Registry when the program closes. There is also a method for the user to read and write the program settings to an INI file using the same code as the Registry access.
On my Windows 7 system the Registry read/write works just like it always has on all previous Windows versions. However, on some customer's Windows 7 machines there appears to be a problem with the Registry access. The program settings are either not being read from the Registry or are not being written to the Registry. I think the settings are not being written - but I don't know that. When the user uses the INI file the settings appear to be read and written.
The customer has complained a bit (I'd complain too) but doesn't have the time or doesn't want to take the time to run some simple tests for me to find out what's going on with his Windows 7 system.
So here is my question: Are there any user account settings or permissions that can block the program's access to the Registry? He claims he is an Administrator but I can't even get him to verify that.
I want to do conditional compilation based on whether it is windows 7 or windows 8. Here is the code below.
#if (_WIN32_WINNT >= 0x0602) //Condition to check whether it windows 7 or 8 .Based on this we can load msxml 3 or 6.
#import <msxml6.dll>
#else
#import <msxml3.dll>
#endif
Im building the above code in windows 8 machine.
Issue here is _WIN32_WINNT should have a value 0x0602, it means it is running in windows 8 machine.Instead it has a value 0x0601 (Means it is taking windows version as windows 7 defined in sdkddkver.h).Im not sure after installing windows 8 sdk im not able to see any include or lib files in the path below C:Program Files (x86)Microsoft SDKsWindowsv8.0A . but i can see all include and lib files of sdk version v7.0A available although i did not installed it.
When I write to the Windows 7 Registry at HKEY_LOCAL_MACHINE, I get a return code of 5 which is the "access denied" message when I execute RegCreateKeyEx.
This happens even if the User has administrator rights.
How can I tell Windows 7 to allow the program to write to the registry?
The application is a 32-bit application and it should be allowed to run in either a Windows 7 32-bit or 64-bit machine.
I noticed that when I run certain popular programs, a User Account Control dialog box comes asking:
"Do if you want to allow the following program from an unknown publisher to make changes to this computer".
Should my application call User Account Control and if so, how do I do it in C++ Visual Studio 2008?
I also found out that 64-bit Windows machines have two registry hives. Is there a different code to handle the same task?
I'm Getting exceptions on Windows 7 and Windows 8 on different parts of the Code? Why this can be happening, why the difference in behavior?
View 6 Replies View RelatedBy using visual studio 2010, I have problem calling up on screen keyboard using line below for Windows 7 64 bit.
WinExec("OSK.EXE", SW_SHOW);
However, it is working fine on windows XP 32 bit. How to call up on screen keyboard for 64 bit windows?
Code:
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) {
int nRetCode = 0;
HMODULE hModule = ::GetModuleHandle(NULL);
if (hModule != NULL) {
// initialize MFC and print and error on failure
[Code] ...
Examples: "sql.h" header file how to skip compile in vs 2008 ?
View 2 Replies View RelatedI am writing a GUI application with C++ Visual component Libraries and Win32API under windows OS.
As part of this app, I have to change color of the MS Windows button control depending on the external state.
I understood, Win32 will not support changing button control color directly as it will not support for this.
how to change the button color?
Where in registry the Explorer stores tray icons visibility settings? (Always show, show only notifications, or always hide.)
I know that Microsoft doesn't want us to change these from a program, which may be OK for a home computer, but it becomes a major pain in the ___ for an enterprise environment (as there seems to be no GPO to do this either.) I've seen couple commercial products that were able to do this, so I'm sure there's a "hack" somewhere...
I'm trying to write a program that passes Windows messages back and forth from another program that controls a laboratory instrument. I was able to write a program that successfully passes instructions, as evidenced by the instrument doing what I tell it. However, I am having trouble getting a return status from the instrument. The manual instructs the following:
// demo code, etc.
// send message to the instrument operating software here...
SendMessage(hwnd, WM_COPYDATA, tag, (LPARAM) &cd)
Either a completion message or return data is returned. Remote commands ReturnStatus, ReturnTiming, and ReturnData return data. In either case, data is received through an asynchronous windows message inside Win32 COPYDATASTRUCT type data packet.For example, a typical OnCopyData window callback is shown below, where the string data retrieved is finally stored into a Microsoft CString object. Note the use of variable replyTag, discussed above, which is used to isolate the correct windows message returned.
BOOL CUserDlg::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* cd) {
….
if (cd->dwData == replyTag) {
/* String pointing to status */
CString retStatus = (char*) cd->lpData;
}
….
}
I can't tell if my problem is in generating the replyTag, getting the HWND to my own console window, or the actual receiving part of the code.
When setting the replyTag, the manual instructs: UINT replyTag = RegisterWindowMessage(“SOFTMaxProReplyMsg”);. However, I have to put an "L" in front of the string or I get a data type error (can't convert const char* to LPCWSTR).
When setting a HWND for myself, the manual instructs: HWND MyWnd = GetSafeHwnd().
That produces an error because GetSafeHwnd is a function of the Cwnd class, and I don't have a Cwnd. I have replaced it with HWND MyWnd = GetConsoleWindow();
When listening for the reply message, the manual instructs what I quoted above. However, I again don't have a Cwnd. I therefore simply used
if (cd.dwData == replyTag) {
CString retStatus = (char*) cd.lpData;
}
The above if statement always evaluates false, and the cd.lpdata contains the message that I had sent out instead of a reply message. How to get a reply using my console application. Here is the full code of my function:
Code:
#include "stdafx.h"
#include<iostream>
#include<vector>
#include<string>
#include<afxwin.h>
using namespace std;
void SendCommand(string command) {
// Get tags to identify the receiving and sending messages
[code]....
I am wanting to separate the logic from the visual, but I'm having problems when calling the method that controls the actions of the progress bar timer.
Code:
ifndef PROGRESS_BAR
define PROGRESS_BAR
class Progress_bar{
public:
void set_Progress(ToolStripStatusLabel^ label,Timer^ time){
[Code] ....
The way that I'm calling this method on Form1.h
void set_Progress(toolStripStatusLabel1 ,timer1);
Errors:
Error1error C2182: 'set_Progress' : illegal use of type 'void'h:cry_devprogrammingc++school_mediaschool_mediaForm1.h277
Error2error C2078: too many initializersh:cry_devprogrammingc++school_mediaschool_mediaForm1.h277
Error3error C2440: 'initializing' : cannot convert from 'System::Windows::Forms::Timer ^' to 'int'h:cry_devprogrammingc++school_mediaschool_mediaForm1.h277
i have developed an application in which i have icons in left side pane of application which can be dragged and dropped in client screen. Application is working fine with all the resolution except 1920x1080.
when setting the resolution to 1920x1080 while dragging icons to client area, icon is not attach to mouse pointer. instead there is a gap between the mouse pointer and the icon. i wrote code to identify the screen resolution but it does not seem to recognize 1920x1080 resolution. below code is giving incorrect resolution for 1920x1080 setting.
RECT actualDesktop;
GetClientRect(GetDesktopWindow(),&actualDesktop);
value of 'actualDesktop' variable is {top=0 bottom=783 left=0 right=1536} which is incorrect. according to current resolution size value should be {top=0 bottom=1080 left=0 right=1920}. Due to this, all the icons while dragging are adjusting according to incorrect resolution setting.
how to identify the issue and if there is any limitation with respect to screen resolution in VC++ 6.0 with windows 8 environment.
I am getting same issue when compiling in VS2012 in windows 8. Code does not seem to recognize 1920x1080 resolution setting and downgrading my application look and feel by setting it to lower resolution.
I have created a windows form project in visual studio so that I can use a windows form to interact with the game class that I'm creating, but I'm running into some problems.
For one thing, I would like to be able to call Image::FromFile() one time only during initialization, and store the result in a member variable (called mBGImage). From what I can tell, the variable needs to be of type String^ (this caret symbol is new to me, but I understand it is the "managed code" version of the standard pointer, which would look like String*).
When I try to compile the following code (located in my header file) I get the error :
"error C3265: cannot declare a managed 'mBGImage' in an unmanaged 'BSG::BSGame'".
How can I store the result of Image::FromFile() permanently in my class?
When I try to declare a global variable of type "Image^", I get "error C3145: global or static variable may not have managed type System:rawing::Image ^"
#include "stdafx.h"
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
[Code] ......