Categorized | Video

Simple Windows Programming Tutorial in C++ – Set a window’s position(WIN32 API)


This example only works on Windows (using WIn32 API) Not for first-timers! My first vid… Rate&Comment, What you would like to see next? Used in this video: Win32 and COM development functions: GetForegroundWindow(); Get the window which is currently in the foreground (most of the time is the currently-selected window) SetWindowPos( HWND Window handle, HWND Z order(background,middle,foreground), int x X position on screen, int y Y position on screen, int CX Width of window, int CY Height of window, UINT uflags Specifies the window sizing and positioning flags. ); Windows API(Application Programming Interface) HWND- A Window handle, used to gain access to a window… Standard Library. std::cout //std:: is replaced by initiating “using namespace std;” in the beginning of the program. std::system/system(const char* command); Tells the command processor( in our case, CMD) to execute a command( same as just writing the command in the shell itself) Sleep(__in DWORD dwMilliseconds); Suspends the execution of the current thread for N milliseconds.

Related Posts
  • Windows Simple Protector Adware Removal Instructions
    The Emsisoft malware research team has discovered a new outbreak of the Windows Simple Protector adware. Emsisoft Anti-Malware detects this malware as Adware.Win32.WindowsSimpleProtector. Windo...
  • Doctor Who calling-on Skype, with malware
    Earlier this week, I received a phone call via Skype on my laptop, the caller's ID was "dralerthelpzc8" as in Dr Alert Help ZC8. The voice on the other end was automated, computerized and otherwise no...
  • KB2506014 kills TDL4 on x64
    Not so long ago, Microsoft released a security patch addressing the way Windows x64 operating systems check integrity of the loaded modules. In our recent report (The Evolution of TDL4: Conquering x64...
  • Windows Restore Adware Removal Instructions
    The Emsisoft malware research team has discovered a new outbreak of the Windows Restore adware. Emsisoft Anti-Malware detects this malware as Adware.Win32.WindowsRestore. Windows Restore is a r...
  • Video – “Windows Activation” Ransom Trojan
    We recently came across a ransom trojan that prompts the following:"Windows license locked!"The trojan claims that "you should complete activation" and provides several phones numbers.The numb...
  • Windows Repair Adware Removal Instructions
    The Emsisoft malware research team has discovered a new outbreak of the Windows Repair adware. Emsisoft Anti-Malware detects this malware as Adware.Win32.WindowsRepair. Windows Repair is a rogu...
  • Windows Process Regulator Adware Removal Instructions
    The Emsisoft malware research team has discovered a new outbreak of the Windows Process Regulator adware. Emsisoft Anti-Malware detects this malware as Adware.Win32.WindowsProcessRegulator. Win...
  • Windows Passport Utility Adware Removal Instructions
    The Emsisoft malware research team has discovered a new outbreak of the Windows Passport Utility adware. Emsisoft Anti-Malware detects this malware as Adware.Win32.WindowsPassportUtility. Windo...
  • Windows Recovery Adware Removal Instructions
    The Emsisoft malware research team has discovered a new outbreak of the Windows Recovery adware. Emsisoft Anti-Malware detects this malware as Adware.Win32.WindowsRecovery. Windows Recovery is ...
  • Protect Files From Malware With Windows Integrity Levels
    In an earlier post, I wrote about the use of the powerful Windows feature called mandatory integrity levels (MIC) to protect processes from spyware. In this follow-up note, I’d like to explore how int...

c windows position

16 Responses to “Simple Windows Programming Tutorial in C++ – Set a window’s position(WIN32 API)”

  1. SniperGryphon says:

    Fuck man, goto a doller store and buy a fucking $1 microphone and plug it in, its not that fucking hard.

  2. 00CC66 says:

    Annoying Music.!!!!!!!!!!!!!!!!!11

  3. KaijeTheGreat says:

    SetWindowPos(GetForegroundWindow(), HWND_TOPMOST, 0, 0, 100, 100, SWP_NOSIZE | SWP_NOZORDER);

    The flags can be used to ignore arguments, use the code above and it will jsut set the position and not change the size or order

  4. trobosavroi199 says:

    you sould put some “endl” after the 3 2 1
    so it look better….

  5. 0121ryanh117 says:

    And I have just started using openGL with the windows API :)

  6. noobay says:

    Guess what I just found out the Layered Window API works flawlessly with D3D(if you set the backbuffer and the color key for blending to Black)
    brings up many possibilities, yay WinAPI!

  7. 0121ryanh117 says:

    Although, I love the windowsAPI :)

  8. CharlestonChew03 says:

    =O Awesome video! Deliciouse knowledge!

  9. noobay says:

    is only for debugging inside the MSVS IDE*

  10. noobay says:

    umm, because if you were to run the .exe from the directory, it won’t pause then.
    Ctrl+F5 is just for debug O_O.
    Thanks?!

  11. sheheryar25 says:

    why don’t you press Ctrl+F5, then u wouldn’t need to write system(“PAUSE”);
    thanks

  12. 0121ryanh117 says:

    if you want to make GUI application, Qt might be a good thing to use. Windows API programming is pretty tough as its so low level.

  13. kitonjics says:

    GREAT MAN… but do you can tell me how do you learn it? its very interesting for me…. thx

  14. noobay says:

    haha :D

  15. uninoculated says:

    cool . lol I had to debug it myself because I got too anxious lol

  16. Genshyu says:

    Awesome song

Trackbacks/Pingbacks


Security Status

Beware Facebook "Timeline" scams http://t.co/W5EW0cVv
5 months ago
Nigerian government (unknowingly) hosts phishing website http://t.co/uQd42ENw
5 months ago
PCMag Awards McAfee All Access its Editors’ Choice: SANTA CLARA, Calif.--(BUSINESS WIRE)--McAfee today announced... http://t.co/FakV7Vd8
5 months ago
RT @mikko: I hadn't noticed Google Maps has added 3D models of buildings. Here's a (very accurate) view of F-Secure HQ in Helsinki http://t.co/IKfAZlak
5 months ago
North Koreans aren't known for their online presence. But others may be lured into clicking Kim Jong-Il 'videos' too http://t.co/yQOon6YT
5 months ago
How to Protect Your Professional Reputation on Facebook Timeline http://t.co/I4bcR2VN
5 months ago
This is pretty impressive from @Softpedia: Facebook scans 2 trillion link clicks and blocks 220 million posts each day http://t.co/vKsn9gNl
5 months ago
Need for integrated approach to security in industrial control systems - http://t.co/tPBCNOow with @PikeResearch
5 months ago
Some free-based music we play at work http://t.co/xu5agZfc
5 months ago
Japan’s cyber defense weapon: a virus. It includes quotes by @Luis_Corrons via @InfosecurityMag
5 months ago