Click here to Skip to main content
15,891,689 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: OpenCV in MFC App Pin
SoMad6-Feb-14 13:12
professionalSoMad6-Feb-14 13:12 
GeneralRe: OpenCV in MFC App Pin
SoMad6-Feb-14 13:36
professionalSoMad6-Feb-14 13:36 
QuestionWinAPI/C++/Dialog - ChooseColor() ignoring mouse Pin
Derell Licht5-Feb-14 6:44
professionalDerell Licht5-Feb-14 6:44 
GeneralRe: WinAPI/C++/Dialog - ChooseColor() ignoring mouse Pin
Richard MacCutchan5-Feb-14 7:12
mveRichard MacCutchan5-Feb-14 7:12 
GeneralRe: WinAPI/C++/Dialog - ChooseColor() ignoring mouse Pin
Derell Licht5-Feb-14 7:40
professionalDerell Licht5-Feb-14 7:40 
GeneralRe: WinAPI/C++/Dialog - ChooseColor() ignoring mouse Pin
Richard MacCutchan5-Feb-14 7:52
mveRichard MacCutchan5-Feb-14 7:52 
GeneralRe: WinAPI/C++/Dialog - ChooseColor() ignoring mouse Pin
Derell Licht5-Feb-14 8:17
professionalDerell Licht5-Feb-14 8:17 
Questionproblem with RegSetvalue in c++ Pin
mohamad mahdi zeinali5-Feb-14 1:18
mohamad mahdi zeinali5-Feb-14 1:18 
hi all
i want to disapear hibernate in startup with registry by c++
and i've got problem with it

C++
#include <windows.h>
#include <iostream>
#include "string.h"
using namespace std;

int main ()
{

 
HKEY hKey;



LPCTSTR sk = TEXT("SYSTEM\\CurrentControlSet\\Control\\Power");

LONG openRes = RegOpenKeyEx(HKEY_LOCAL_MACHINE, sk, 0, KEY_ALL_ACCESS , &hKey);

if (openRes==ERROR_SUCCESS) {
    printf("Success opening key.");
} else {
    printf("Error opening key.");
}

LPCTSTR value = TEXT("HibernateEnabled");
LPCTSTR data = L"0\0";


LONG setRes = RegSetValueEx (hKey, value, 0, REG_DWORD, (LPBYTE)data, 1);



if (setRes == ERROR_SUCCESS) {
    printf("Success writing to Registry.");
} else {
    printf("Error writing to Registry.");
}
cout << setRes << endl;

LONG closeOut = RegCloseKey(hKey);
if (closeOut == ERROR_SUCCESS) {
    printf("Success closing key.");
} else {
    printf("Error closing key.");
}
cin.get();
}

what is the problem with it !
please help me
AnswerRe: problem with RegSetvalue in c++ Pin
Richard MacCutchan5-Feb-14 1:39
mveRichard MacCutchan5-Feb-14 1:39 
GeneralRe: problem with RegSetvalue in c++ Pin
mohamad mahdi zeinali5-Feb-14 1:52
mohamad mahdi zeinali5-Feb-14 1:52 
GeneralRe: problem with RegSetvalue in c++ Pin
Richard MacCutchan5-Feb-14 2:03
mveRichard MacCutchan5-Feb-14 2:03 
QuestionWNetGetConnection API behaves wrongly when UAC is enabled Pin
atm.menon4-Feb-14 19:19
atm.menon4-Feb-14 19:19 
GeneralRe: WNetGetConnection API behaves wrongly when UAC is enabled Pin
Malli_S4-Feb-14 22:00
Malli_S4-Feb-14 22:00 
GeneralRe: WNetGetConnection API behaves wrongly when UAC is enabled Pin
atm.menon12-Feb-14 15:38
atm.menon12-Feb-14 15:38 
QuestionLining up the Decimal Points Pin
BobInNJ4-Feb-14 16:50
BobInNJ4-Feb-14 16:50 
AnswerRe: Lining up the Decimal Points Pin
Malli_S4-Feb-14 21:58
Malli_S4-Feb-14 21:58 
GeneralRe: Lining up the Decimal Points Pin
BobInNJ5-Feb-14 3:24
BobInNJ5-Feb-14 3:24 
GeneralRe: Lining up the Decimal Points Pin
Malli_S5-Feb-14 21:12
Malli_S5-Feb-14 21:12 
QuestionRe: Lining up the Decimal Points Pin
David Crow5-Feb-14 6:18
David Crow5-Feb-14 6:18 
AnswerRe: Lining up the Decimal Points Pin
BobInNJ5-Feb-14 11:10
BobInNJ5-Feb-14 11:10 
SuggestionRe: Lining up the Decimal Points Pin
David Crow5-Feb-14 16:07
David Crow5-Feb-14 16:07 
GeneralRe: Lining up the Decimal Points Pin
BobInNJ6-Feb-14 2:10
BobInNJ6-Feb-14 2:10 
QuestionProper array memory management in C++ Pin
Don Guy3-Feb-14 12:43
Don Guy3-Feb-14 12:43 
AnswerRe: Proper array memory management in C++ Pin
Richard MacCutchan3-Feb-14 21:42
mveRichard MacCutchan3-Feb-14 21:42 
AnswerRe: Proper array memory management in C++ Pin
Maximilien4-Feb-14 5:26
Maximilien4-Feb-14 5:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.