|
Unless you can convince me otherwise, I consider that to be very non user-friendly. If I'm working on the computer and some application decides that the monitor needs to go off and I can't turn it back on by moving the mouse, I would seriously consider removing that application.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Yes, you're right for this point, but my application is targeting PC which displays multimedia messages on screens (LCD or Plasma) and, normally, there are no interactive users on these machines.
My application must turn off/on screens when no messages are displayed in order to save LCD/Plasma life time. My solution works well because, for that kind of PC, there are no users, but I want to develop my application properly, and I cannot accept that the screen could turn on without my application.
Maybe this is not possible on Windows platform to turn off properly the screen.
The last thing I would say is that I could do that on Atari ST platform, and fifteen years later, I could not do the same thing on Windows platform fifteen years old ?!! I think this is the progress...
Thanks for your response.
|
|
|
|
|
hkulten wrote:
::SendMessage(hWnd, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_OFF);
the SC_MONITORPOWER doesn't really turn the monitor off, it only make use of the power-saving feature of the monitor ( just like the screensaver does )
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Yes you are right, but my purpose is to use this power-saving feature from my application. I want to be able to turn on/off monitor when I need, and no turn back on of the display when the mouse is moving.
Maybe are there softwares which can do that ?
Thanks.
|
|
|
|
|
Does anyone know how to hook a game engine? Or where to find the full source to the unreal Game Engine in C++?
|
|
|
|
|
Try posting this at
www.gamedev.net[^]
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
for game hacking this is the wrong address. I propose cheating pages!
Don't try it, just do it!
|
|
|
|
|
CopyFile("c:\\boot.ini","\\\\127.0.0.1\\e:\\boot.ini",FALSE);when I use the copyfile function after I have established a ipc$ connection with the target machine which I'd like to copy file to ,I receive a error code 67(using getlasterror),the error remains even when I change the ip address of the targe machine,and I think there is no syntax error ,what's the reason?
|
|
|
|
|
I've not tried this before, so this is just a guess, but shouldn't e: be mapped to a server\share on the target machine? In other words, if e: were mapped to \\127.0.0.1\someshare, then the target would simply be e:\boot.ini. Yes?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I inject a mfc dll inside a process, after i create a windows a windows using CWnd::CreateEx inside CWinApp::InitInstance but when InitInstance finished my windows is closed. I tried to solve this problem creating a new thread and inside this thread a create my windows but when i call CWnd::CreateEx my process crash. how can i solve this problem? how can i create a new windows in a MFC Dll injected inside another process?
|
|
|
|
|
Check this article
http://www.codeproject.com/system/hooksys.asp[^]
(Check the code near CreateRemoteThread)
How are you creating you window? on the stack or on the heap?
And what functions are you using to allocate memory?
(Consider VirtualAllocEx family of API)
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Thks but i resolve the problem, its a bug of MFC, i resolve with this code (its a test code that i create it)
<br />
CMsnNvHookApp theApp; <br />
<br />
DWORD WINAPI ThreadStart (LPVOID dwThreadId) { <br />
::Sleep(300); <br />
<br />
AFX_MODULE_STATE *ModStat; <br />
<br />
ModStat = AfxGetStaticModuleState(); <br />
ModStat->m_pCurrentWinApp = &theApp; <br />
ModStat->m_hCurrentInstanceHandle = ::GetModuleHandle(NULL); <br />
<br />
AFX_MANAGE_STATE(ModStat); <br />
<br />
theApp.m_hThread = ::GetCurrentThread(); <br />
theApp.m_nThreadID = m_nThreadID; <br />
theApp.m_hInstance = ::GetModuleHandle(NULL); <br />
<br />
CFrameWnd *MainWin = new CFrameWnd(); <br />
<br />
MainWin->Create(NULL,"Prueba"); <br />
MainWin->ShowWindow(SW_SHOW); <br />
<br />
theApp.m_pMainWnd = MainWin; <br />
<br />
theApp.Run(); <br />
<br />
return TRUE; <br />
} <br />
<br />
BOOL CMyApplication::InitInstance() <br />
{ <br />
DWORD dwThreadId; <br />
<br />
::CreateThread(NULL,0,ThreadStart,0,0,&dwThreadId); <br />
<br />
return CWinApp::InitInstance(); <br />
}<br />
<br />
And i use a inject library called madCHook.dll <a href="http://www.madshi.net/">http:
|
|
|
|
|
I am practising writting a windows application purely by hand and by using windows API , as I am a beginner in windows programming and want to do some studying.
In almost all the explanations to the provided facilities, I find in the header section such statements as "declared in..., include windows.h", so I thought the facilities would be availabe so long as windows.h was included.
But that immediately proved wrong in compiling.
Yet more embarrassing is the function WinMain, I wrote it with returning type int, as is stated in MSDN, but the compiler(VC 6.0)reported errors for this.
Can you tell me how I can use the API functions and how to handled this problem?
Thank you for any help!
|
|
|
|
|
Well it would help if you listed the errors.
Have you tried using the AppWizard to generate a Win32 Application. This will help you to understand what is needed to create a pure Win32 app.
If you want to learn about the make-up of a Win32 app, I recommend this book[^]
Michael
CP Blog [^]
|
|
|
|
|
Thank you for your help!
I debugged the program again and solved some of the problems by myself. But the following one is really puzzling:
VC6.0 reported after compiling:
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
The WinMain function is written as follows:
int _stdcall WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
{
//register the window class and carry out things like that
}
I used the appWizard to create a win32 application and all the problems were gone. However, I still don't understand why the error was reported. _main is not defined in the win32 application either.
Thank you for all your help!
|
|
|
|
|
See if MSDN article Q291952 is of any help.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Just wanted to say thanks for posting this! I ran into the same problem and the article solved it for me! Thanks!!
Mike Ellertson
|
|
|
|
|
hey, just a tiny problem:
i use a CDialog with a couple of CustomCtrls arrange vertical. My CustomCtrl uses a CToolTipCtrl to display ctrl states.
When the Tooltip appears the control "under" the tooltip would not be repainted up to to the time the dialog call invalidate or the control gets the focus.
How can I solve that problem?
|
|
|
|
|
Hi,
I want to open multiple childs windows inside one of the childframe window of an MDI application. Any idea about how to achieve this?.
Details is like below:
I have my mainframe window derived from CMDIFrameWnd. Now in one of the childframe ( derived from CMDIChildWnd ) I want to open mutiple child windows i.e my child frame should behave as a parent to another child windows. Please let me know how to achieve this.
Any sample would be of great help.
Thanks,
Amit
|
|
|
|
|
The classic point to create child windows would in your CChildFrame::OnCreate handler.
I know the CSplitterWnd stuff goes there. You can also add toolbars etc at that point.
Iain.
|
|
|
|
|
Have a wierd one. One of our customers recently purchased a new computer with XP PRO installed. Out software prints fine on others customer's pcs running XP PRO, but this one wants to print everything upside down and backwards. Has anyone ever seen this happen. Would appreciate anyone's input.
Walt McWhirter
Compact Communications Systems
|
|
|
|
|
Have you tried putting the paper in the other way around?
More seriously, I would look at differences in printer / printer drivers rather than XP.
I used to have a lot of problem with Epson drivers when HP ones worked just fine.
Does the problem happen when you change printers? Does it happen on a known-good-system
with the suspect printer?
Does the issue happen if you print from another application? Or just yours? I usually
use Wordpad as a simple should-be-fine application.
Is it just an (obsure) option in the print setup?
Iain.
|
|
|
|
|
This is likely some really obscure print driver option that is running amuck, but if you solve it, I'd love to hear the reason. This sounds like a great trick to play on some of my evil co-worker's PC. :mwaahaaha:
Chris Meech
We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton
VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler
|
|
|
|
|
I have just compiled an old VC6 project in VS.NET 2003 and I am getting some odd errors. It's been a while since I did any C++ and am a bit rusty so any help would be appreciated.
In the following code:
template<class T> class COpList <br />
{<br />
public:<br />
<br />
COpList(); <br />
~COpList();<br />
<br />
bool ParseList(CTokenizer&);<br />
void StartIterator(void) const;<br />
const T* GetOp(void) const;<br />
<br />
void Display(ostream&) const;<br />
string GetAsText(void) const;<br />
<br />
private:<br />
<br />
void AddOpListElement(const string&);<br />
<br />
typedef vector<T*> OPVEC;<br />
OPVEC m_vecOpList;<br />
mutable vector<T*>::const_iterator m_it;<br />
};
The last line in the class (in bold) is giving the error:
error C2146: syntax error : missing ';' before identifier 'm_it'<br />
What is it telling me? I have looked it up in help and it seems to have something to do with specialisation but, as I say, I am kinda rusty on C++. Any help would be appreciated.
Thanks
Paley.
Rugby League: The Greatest Game Of All.
|
|
|
|
|
Have you got an #include <vector> at the top of the .h file?
Ant.
|
|
|
|