Computer/C, CPP, MFC

[CPP, MFC] ์œˆ๋„์šฐ, ๋‹ค์ด์–ผ๋กœ๊ทธ ์ตœ๋Œ€ํ™”

์ดˆ๊ธฐํ™”๋ถ€๋ถ„์—์„œ, this->ShowWindow(SW_SHOWMAXIMIZED); this->UpdateWindow(); ๋„์›€. SW_HIDE : ์œˆ๋„์šฐ๋ฅผ ํ™”๋ฉด์— ๋ณด์ด์ง€ ์•Š๊ฒŒ ํ•œ๋‹ค. SW_MINIMIZE : ์œˆ๋„์šฐ๋ฅผ ์ตœ์†Œํ™”ํ•œ๋‹ค. SW_RESTORE : ์œˆ๋„์šฐ๋ฅผ ์›๋ž˜์˜ ํฌ๊ธฐ์™€ ์œ„์น˜๋กœ ํ™”๋ฉด์— ํ‘œ์‹œํ•œ๋‹ค. SW_SHOW : ์œˆ๋„์šฐ๋ฅผ ํ™”๋ฉด์— ๋ณด์ด๊ฒŒ ํ•œ๋‹ค. SW_SHOWMAXIMIZED : ์œˆ๋„์šฐ๋ฅผ ์ตœ๋Œ€ํ•œ ํฌ๊ฒŒ ํ•˜์—ฌ ํ‘œ์‹œํ•œ๋‹ค. SW_SHOWMINIMIZED : ์œˆ๋„์šฐ๋ฅผ ์ตœ์†Œํ•œ ์ž‘๊ฒŒ ํ•˜์—ฌ ํ‘œ์‹œํ•œ๋‹ค. SW_SHOWMINNOACTIVE : ์œˆ๋„์šฐ๋ฅผ ์•„์ด์ฝ˜์œผ๋กœ ํ‘œ์‹œํ•œ๋‹ค. SW_SHOWNA : ์œˆ๋„์šฐ๋ฅผ ํ˜„์žฌ ์ƒํƒœ๋กœ ํ‘œ์‹œํ•œ๋‹ค. SW_SHOWNOACTIVATE : ์œˆ๋„์šฐ๋ฅผ ๊ฐ€์žฅ ์ตœ๊ทผ์˜ ํฌ๊ธฐ์™€ ์œ„์น˜๋กœ ํ‘œ์‹œํ•œ๋‹ค. SW_SHOWNOR..
Computer/C, CPP, MFC

๊ณต์šฉ ์–ธ์–ด ๋Ÿฐํƒ€์ž„ ์ง€์›์˜ ์„ค์ •์— ๋”ฐ๋ผ ๋นŒ๋“œ ๊ฒฐ๊ณผ๊ฐ’์ด ๋‹ค๋ฅด๋‹ค?

์˜ค์ž‰? ์™œ! ์™œ! ๋‹ค๋ฅด๊ฒŒ ๋ณด์ด๋Š”๊ฑฐ์•ผ??!? ์˜ˆ์ „์— ๋งŒ๋“ค์–ด๋‘” MFCํ”„๋กœ๊ทธ๋žจ์—์„œ ๋ณด๋Š”๊ฒƒ๊ณผ ์ฒ˜๋ฆฌ๊ฐ’์ด ๋‹ค๋ฅด๊ฒŒ ๋ณด์ด๋Š”๊ฒƒ์ด๋‹ค. ์˜ค? ์™œ ์ด๋Ÿฌ์ง€ ๋‚ด๊ฐ€ ์ž˜ ๋ชป ๋งŒ๋“ค์—ˆ๋‚˜? (๊ทธ๋ ‡์ง€... ์ปดํ“จํ„ฐ๋Š” ๊ฑฐ์ง“๋ง ์•ˆํ•˜๋‹ˆ๊นŒ~) ๋””์ž์ธ ํŒŒ์ผ์ด๋ผ์„œ ๋ฐ์ดํ„ฐ ํ•˜๋‚˜ํ•˜๋‚˜๊ฐ€ ์ค‘์š”ํ•œ๋ฐ.. ๊ทธ๋ž˜์„œ ํ™•์ธ์ด ํ•„์š”ํ–ˆ๋‹ค. ๊ณ„์‚ฐ๊ธฐ ์˜คํ”ˆ!! hex ๊ฐ’ 96 ์ด๋ฉด dec๋กœ 150์ด ๋งž๋Š”๋ฐ ์˜ค์ž‰?! ์˜ค์ž‰? 0.00001์ดˆ ์ •๋„ ํ•˜๊ณ ... ๋‹น์—ฐํ•˜๋‹ˆ๊นŒ~ ๊ณ„์‚ฐ๊ธฐ ์ฒ˜๋ฆฌ ๋‹จ์œ„๋ฅผ ๋ฐ”๊ฟ”๋ณด์•˜๋‹ค. ๊ทธ๋žฌ๋‹ค. ๋ญ... ๋‹น์—ฐํ•˜๊ณ  ์‚ฌ์‹ค -106์ด ๋งž๋‹ค.............................. ๋Š” ์•ˆ๋ผ!!! ๋‚œ ์ €๊ฑธ ์›ํ•˜๋Š”๊ฒŒ ์•„๋‹ˆ๋ผ๊ณ !!! ๊ทธ๋ž˜์„œ ๋ญ๊ฐ€ ๋ฌธ์ œ์ผ๊นŒ? ๋‹จ์œ„๋„ ๋ฐ”๊พธ๊ณ  ๋น„ํŠธ๋„ ์ž๋ฅด๊ณ  ํ–ˆ์ง€๋งŒ, ๊ท€์ฐฎ๋‹ค.. ๋นŒ๋“œ ์„ค์ • ๋ฌธ์ œ์ธ๊ฐ€ ์‹ถ์–ด์„œ ํ”„๋กœ์ ํŠธ ์†์„ฑ์„ ํ™•์ธํ–ˆ๋‹ค. ์˜์‹ฌ๋˜์–ด ๋ณด..
Computer/C, CPP, MFC

CRegKey/SetValue ๋ฐ”๊พธ์ž

๋””์ž์ธ๋ณ€ํ™˜ ํ”„๋กœ๊ทธ๋žจ์„ ๋งŒ๋“ค์ผ์ด ์žˆ์–ด์„œ ์˜ค๋žœ๋งŒ์— C++๋ฅผ ๋งŒ์ง€์ž‘ ๋งŒ์ง€์ž‘ ํ•˜๋˜ ์ค‘, ๋ ˆ์ง€์ŠคํŠธ๋ฆฌ์— ์ €์žฅ๋œ ๊ฐ’์„ ๋ถˆ๋Ÿฌ์˜ค๊ณ , ์ €์žฅํ•  ์ผ์ด ์ƒ๊ฒผ๋‹ค. ๊ทธ๋ž˜์„œ ์ƒ๊ฐ์—†์ด, ์˜ˆ์ „์— ๋งŽ์ด ์‚ฌ์šฉํ•˜๋˜ ๊ทธ๋•Œ ๊ทธ ์ฝ”๋“œ๋กœ ์‚ฌ์šฉํ–ˆ๋‹ค. ์ €์žฅํ• ๋•Œ, SetValue๋ฅผ... CRegKey RegKey; RegKey.Create(HKEY_CURRENT_USER, "๋ธ”๋ผ๋ธ”๋ผ"); RegKey.SetValue(nConversionEnabled, "์ด๊ฑฐ๋ธ”๋ผ๋ธ”๋ผ"); RegKey.Close(); ๊ทธ๋ฆฌ๊ณ  ๋นŒ๋“œ. ๋นŒ๋“œ. ๋นŒ๋“œ... ์œผ์›€? ์™œ!!!!!!!! C4996์ด ๋œจ๋ƒ๊ณ !!!!! ๊ทธ๋žฌ๋‹ค. ๋˜, ๋ฌด์–ธ์ธ๊ฐ€ ๊ณ ์ „ํ‹ฑํ•œ ๊ณ ์ „๊ณ ์ „์˜ ๋Š๋‚Œ์ด๋ผ ์ทจ์•ฝ์ ์ด ์žˆ๊ฒ ์ง€. ์˜ค๋ฒ„ํ”Œ๋กœ์šฐ๊ฐ€ ์ƒ๊ธธ์ˆ˜ ์žˆ์„๋ ค๋‚˜... ๋ฐ”๋กœ ๊ฒ€์ƒ‰! ๋šœ๋šฑ! ํ•ด๋‹นํ•จ์ˆ˜๋Š” QueryValueEx , Setval..
Computer/C, CPP, MFC

ReadFile()

๊ฐ„๋‹จ์ •๋ฆฌ RedFile(ํŒŒ์ผํ•ธ๋“ค, ์ €์žฅ๋ฒ„ํผ ํฌ์ธํ„ฐ, ์ฝ์–ด์˜ค๋Š” ๋ฐ”์ดํŠธ์ˆ˜,์ถœ๋ ฅ์šฉ์ธ์ˆ˜, ๋น„๋™๊ธฐ์•„๋‹ˆ๋ฉด NULL) ReadFile() ํŒŒ์ผ์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ฝ์–ด์˜ด. ๋™๊ธฐ, ๋น„๋™๊ธฐ ๋ชจ๋‘ ์‚ฌ์šฉ๊ฐ€๋Šฅํ•จ. ์›ํ˜• BOOL ReadFile( HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped ); - HANDLE hFile: ์ฝ๊ณ ์ž ํ•˜๋Š” ํŒŒ์ผ์˜ ํ•ธ๋“ค. ์ด ํŒŒ์ผ์€ GENERIC_READ ์•ก์„ธ์Šค ๊ถŒํ•œ์œผ๋กœ ์—ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. - LPVOID lpBuffer: ์ฝ์–ด ์˜ฌ ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•  ๋ฒ„ํผ์˜ ํฌ์ธํ„ฐ ์ž…๋‹ˆ๋‹ค. - DWORD nNumberOfBytesToRead: ์‹ค์ œ ์ฝ์–ด์˜ค๋Š” ๋ฐ”์ดํŠธ ์ˆ˜๋ฅผ ์ง€..

ReadFile()

Computer/C, CPP, MFC

SetFilePointer()

๊ฐ„๋‹จ์ •๋ณดSetFilePointer(๋Œ€์ƒ ํŒŒ์ผ์˜ ํ•ธ๋“ค, ์˜ฎ๊ธธ ์œ„์น˜, NULL, ์‹œ์ž‘์œ„์น˜)ํŒŒ์ผ์„ ์ฒ˜์Œ ์—ด์—ˆ์„๋•Œ, ํฌ์ธํ„ฐ์˜ ์œ„์น˜๋Š” ํŒŒ์ผ์˜ ์ฒ˜์Œ, IO ์ฒ˜๋ฆฌ์— ๋”ฐ๋ผ ํŒŒ์ผํฌ์ธํ„ฐ๊ฐ€ ์ž๋™์œผ๋กœ ์ด๋™. SetFilePointer()ํŒŒ์ผ ํฌ์ธํ„ฐ๋ฅผ ์›ํ•˜๋Š” ์œ„์น˜๋กœ ์˜ฎ๊ธธ๋•Œ ์‚ฌ์šฉ.32๋น„ํŠธ์™€ 64๋น„ํŠธ๋ฅผ ๋™์‹œ์— ์ง€์›ํ•˜๊ธฐ ์œ„ํ•ด 2๋ฒˆ์งธ ์ธ์ˆ˜์™€ 3๋ฒˆ์งธ ์ธ์ˆ˜๋ฅผ ํ†ตํ•ด ๊ฐ 4๋ฐ”์ดํŠธ์”ฉ 64๋น„ํŠธ, ์˜คํ”„์…‹์„ ์ „๋‹ฌํ• ์ˆ˜ ์žˆ๋‹ค.SetFilePointerEx ๋ฅผ ์‚ฌ์šฉํ•˜๋Š”๊ฒƒ์ด ์ข‹๋‹ค. ์›ํ˜•DWORD SetFilePointer( HANDLE hFile, LONG IDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod); - HANDLE hFile: ํŒŒ์ผํฌ์ธํ„ฐ๋ฅผ ์˜ฎ๊ธฐ๊ณ ์ž ํ•˜๋Š” ๋Œ€์ƒ ํŒŒ์ผ์˜ ํ•ธ๋“ค. - LO..
Computer/C, CPP, MFC

ํ”„๋กœ๊ทธ๋žจ ์ข…๋ฃŒ

ํ”„๋กœ๊ทธ๋ž˜๋ฐ์„ ํ•˜๋˜์ค‘ ์–ด๋–ป๊ฒŒ ํ•˜๋ฉด ์•ˆ์ „ํ•˜๊ฒŒ ํ”„๋กœ๊ทธ๋žจ์„ ์ข…๋ฃŒํ• ๊นŒ ์ƒ๊ฐํ•ด๋ณด์•˜๋‹ค.๋ฐ”๋กœ ๊ตฌ๊ธ€๋ง ๋ฉ”๋ชจ๋ฆญ ๋ฐœ์ƒ ๋•Œ๋ฌธ์—..๋ฌธ์ œ๋“ค์ด ๋Œ€๋ถ€๋ถ„ ๋ฐœ์ƒํ•˜๋Š”๊ฒƒ์œผ๋กœ ๋ณด์—ฌ์ง€๋”๋ผ.. ์•„ํ•˜! ๊ทธ๋ ‡๊ตฌ๋‚˜, ๋ผ๊ณ  ๋‹ค์‹œ ํ•œ๋ฒˆ ๋Š๋‚€ ํ›„... ์“ฐ๋˜๋Œ€๋กœ ๊ทธ๋ƒฅ 'ExitProcess' ์ด๊ฑฐ ์‚ฌ์šฉํ•˜์˜€๋‹ค. ๋! ๋ฉ”์ธ ๋‹ค์ด์–ผ๋กœ๊ทธ::OnInitDialog()์—์„œ ํ”„๋กœ๊ทธ๋žจ์„ ์ข…๋ฃŒํ•˜๊ณ  ์‹ถ๋‹ค.OnClose๋‚˜ ๊ธฐํƒ€ ๋ฉ”์†Œ๋“œ๊ฐ€ ๋จน์ง€ ์•Š๊ฑฐ๋‚˜ ๋จน์–ด๋„ ๋ฉ”๋ชจ๋ฆฌ ์ถฉ๋Œ ์˜ค๋ฅ˜๋ฉ”์‹œ์ง€๊ฐ€ ๋‚˜์˜จ๋‹ค.exit(0);๋ฅผ ๋„ฃ์–ด์ค˜๋„ ๋˜๋‚˜ ๋น„์ •์ƒ์ ์ธ terminated๋ผ ๋ฉ”๋ชจ๋ฆฌ ๋ˆ„์ˆ˜๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค. ๋ฐฉ๋ฒ•์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค. ::SendMessage(this->m_hWnd, WM_CLOSE, NULL, NULL);ํ˜น์€ ::SendMessage(GetSafeHwnd(), WM_CLOSE, NULL, NULL..
Computer/C, CPP, MFC

์œˆ๋„์šฐ ๋ฒ„์ „ ์•Œ์•„๋ณด๊ธฐ

int GetWindowsType(void) { /* return value : -1 : ๋ฒ„์ „์–ป๊ธฐ ์‹คํŒจ 1 : Windows 95, 2 : Windows 98, 3 : Windows ME, 4 : Windows NT, 5 : Windows 2000, 6 : Windows XP, 7 : Windows 2003, 8 : Windows Vista, 2008 9 : Windows 7, 2008 R2 10: Windows 10, */ int nVersion = -1; OSVERSIONINFOEX osvi = { 0, }; BOOL version_ex_flag = 0; osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); if (!(version_ex_flag = GetVer..
Computer/C, CPP, MFC

timeSetEvent ์™€ ์นœ๊ตฌ๋“ค

์ดํ‹€์งธ, ํ”„๋กœ๊ทธ๋žจ์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ๋ณด๋‚ด์ฃผ๋Š”๊ฑธ ํ™•์ธํ•˜๋Š” ๋ถ€๋ถ„์ด ์žˆ๋Š”๋ฐ (์‚ฌ์‹ค ์ด๋ถ€๋ถ„๋„ ๋ชฐ๋ž๋‹ค..๋‚ด๊ฐ€ ๋งŒ๋“ ๊ฒŒ ์•„๋‹ˆ๋‹ˆใ…œใ…œ)๊ณ„์† ๋ฌดํ•œ๋ฃจํ”„ ๊ฑธ๋ ธ๋Š”์ง€ '์‘๋‹ต์—†์Œ' ์œผ๋กœ๋„๋„ํ•œ ๋…€์„ ๊ฐ™์œผ๋‹ˆ ๋Œ€๊พธ๊ฐ€~ ์—†์–ด!!!!!!!! ์ด๋ฆฌ๋ณด๊ณ  ์ €๋ฆฌ๋ณด๊ณ  ์ด๋ถ€๋ถ„์ผ๊บผ๋ผ๊ณ  ์˜ˆ์ƒ์€ ๋˜์—ˆ๋‹ค.. WaitForSingleObject ์˜ˆ์ƒ์€ ํ–ˆ์ง€๋งŒ, ์—ญ์‹œ๋‚˜... ์ด๋…€์„๊ณผ ๊ฐ™์ด ๋†€๊ณ  ์žˆ๋Š” ๋…€์„์ด ๋ฒ”์ธ์ด์˜€๋‹ค.timeSetEvent์ด๋†ˆ์˜ด~!!! ์žฌํ˜„์ด 1์‹œ๊ฐ„์ด์ƒ ๊ฑธ๋ฆฌ๋‹ˆ.. ใ…œใ…œ์ง€๋ฃจํ•ด~ WaitForSingleObject ์—์„œ ๋ฐ›์•„์•ผ๋˜๋Š”๋ฐ ๋ฐ›์ง€๋ฅผ ๋ชปํ•˜๋‹ˆ.. ์ฐธ๊ณ : WaitForSingleObject ์ž! ๊ทธ๋Ÿผ timeSetEvent์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด์ž.๋ฉ€ํ‹ฐ๋ฏธ๋””์–ด ํƒ€์ด๋จธ๋กœ ์•„์ฃผ์•„์ฃผ ๋†’์€ ์ •ํ™•๋„์˜ ํƒ€์ด๋จธ์ด๋‹ค.์ผ์ •ํ•œ ์ฃผ๊ธฐ๋งˆ๋‹ค ํ‘œ์‹œ๋œ ์ฝœ๋ฐฑ ํ•จ์ˆ˜๋‚˜ ์ด๋ฒคํŠธ๋ฅผ ํ˜ธ์ถœ ํ•œ๋‹ค. ..
Computer/ETC

Thread(์Šค๋ ˆ๋“œ)

๋ฉ”์ธ์Šค๋ ˆ๋“œ ์™ธ์— ๋‹ค๋ฅธ ์Šค๋ ˆ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋น„๋™๊ธฐ๋กœ ๋™์ž‘ํ•  ํ•„์š”์„ฑ์„ ๋Š๋ผ๊ฒŒ๋œ๋‹ค.์ด๋Ÿด๋•Œ ์Šค๋ ˆ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๊ฐ๊ฐ ๋…๋ฆฝ์ ์ธ ๋™์ž‘์œผ๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค.์Šค๋ ˆ๋“œ๋ฅผ ๋ถ„๋ฆฌํ•˜์ง€ ์•Š๊ณ  ๋ฉ”์ธ์Šค๋ ˆ๋“œ๋กœ๋งŒ ์ด์šฉํ•œ๋‹ค๋ฉด ๋‹ค๋Ÿ‰์˜ ๋ฐ์ดํ„ฐ๋ฅผ ์—ฐ์‚ฐ, ๊ด€๋ฆฌํ•˜๋Š” ๋ถ€๋ถ„์—์„œ ๋™์ž‘์„ ์‹คํ–‰์ค‘์ด๊ธฐ ๋•Œ๋ฌธ์— ๋‹ค๋ฅธ๊ฒƒ๋“ค์€ ํ•˜์ง€ ๋ชปํ•˜๊ณ  ๊ทธ ๋™์ž‘์ด ๋๋‚ ๋•Œ ๊นŒ์ง€ ๊ธฐ๋‹ค๋ ค์•ผํ•œ๋‹ค. ์Šค๋ ˆ๋“œ๋Š” ๋ฉ”์ธ์Šค๋ ˆ๋“œ์™€ ๋…๋ฆฝ๋œ ๋™์ž‘์ด๊ธฐ ๋•Œ๋ฌธ์— ๋ฉค๋ฒ„๋ณ€์ˆ˜๋‚˜ ํ•ด๋‹นํด๋ž˜์Šค์˜ ๊ฐ์ฒด๋ฅผ ์ด์šฉํ•ด์„œ ์ ‘๊ทผํ•ด์•ผํ•œ๋‹ค.์Šค๋ ˆ๋“œ ํ•จ์ˆ˜ ์•ˆ์—์„œ ํ•ด๋‹นํด๋ž˜์Šค์˜ ๋ณ€์ˆ˜๋‚˜ ํ•จ์ˆ˜๋กœ ๋ฐ”๋กœ ์ ‘๊ทผํ•  ์ˆ˜ ์—†๋‹ค. .h ํ—ค๋”//ํƒ€์ž…์€ UINT๋ฅผ ํ•ด์•ผ ํ•˜๊ณ  ๋งค๊ฐœ๋ณ€์ˆ˜ lParam์„ ๋„˜๊ฒจ ์ฃผ์–ด์•ผ ํ•œ๋‹คstatic UINT ThreadProc(void *lParam); .cpp ๊ตฌํ˜„AfxBeginThread(ThreadProc, this); nNum1..
EIGHTBOX
EIGHTBOX
hwaya.

programmer

๐Ÿ‹์ผ์ƒ์˜ ์†Œ์†Œํ•œ ์ˆœ๊ฐ„๋“ค๋ถ€ํ„ฐ ํฐ ๊ฟˆ๊นŒ์ง€, ํ˜ธ๊ธฐ์‹ฌ์„ ๋งŒ์กฑ์‹œํ‚ฌ ๋‹ค์–‘ํ•œ ์นดํ…Œ๊ณ ๋ฆฌ๋ฅผ ๋‹ด์€ ๋ธ”๋กœ๊ทธ ์ž…๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ , ์†Œ์†Œํ•œ ํ–‰๋™์— ๊ฐ๋™ํ•˜๋ฉฐ ๊ธฐ๋ปํ•˜๊ณ  ํ•˜๋ฃจํ•˜๋ฃจ์— ๊ฐ์‚ฌํ•˜๋Š” ์‚ฌ๋žŒ๐ŸŒต

Today Yesterday Total
์ตœ์‹ ๊ธ€