Disabling the Alt-Tab key combination

The simplest way to achieve this is to use the RegisterHotKey function. By calling this function from within your process you take precedence over the O/S. The WM_HOTKEY message that is generated by the specified key combination will be re-directed to the your processes message queue. To block the hotkey, dont process the WM_HOTKEY message that is sent to your queue. Below I have copied a constructor and destructor that demonstrate this action.

// Call the RegisterHotKey function when the application 
// is instantiated to block the ALT-TAB combination
// Note:  The m_nHotKeyID is a int which specifies the hotkey 
//        ID, the hotkey id is programmer defined
CMainFrame::CMainFrame()
{
 m_nHotKeyID = 100;

 BOOL m_isKeyRegistered = RegisterHotKey(GetSafeHwnd(), m_nHotKeyID,
  MOD_ALT, VK_TAB);

 ASSERT(m_isKeyRegistered != FALSE);
}


//lets remove the hotkey block when the application is destroyed
CMainFrame::~CMainFrame()
{
 BOOL m_iskeyUnregistered = UnregisterHotKey(GetSafeHwnd(), m_nHotKeyID);
 ASSERT(m_isKeyUnregistered != FALSE);
}
There you have it, the simplest way to block the ALT-TAB without writing a VxD.

One last thing, the hotkey block will continue as long as your application is running. When your process terminates the hotkey will return to its original functionality.



Comments

  • carpinteyroqtd,cheap christian louboutin uk,christian louboutin outlet uk,christian louboutin sale uk,christian louboutin boots,carpinteyrofeg

    Posted by barpinterko on 07/12/2013 04:48am

    cheap christian louboutin shoes uk A couple of ages in the past, you'll have to visit a particular part of the footwear go shopping to find the proper footwear.christian louboutin outlet online These people exclusively stacked a smaller array of different versions as well as christian louboutin shoes uk sale shades so that you have to be delighted by the perfect couple. On the net stores now offer you an remarkable choice for boot enthusiasts christian louboutin boots uk.

    Reply
  • pnd,christian louboutin uk,christian louboutin outlet,christian louboutin shoes,kub

    Posted by carpinteyrolcu on 07/08/2013 06:49pm

    Rjdspjef Dlctfsio Gdeaensfw Adzyedsjv Btkpvee Jrqvyxexl Aamrnz Clwcjxxde Hpaaamwo Iglpoo christian louboutin uk sale Gjnpxdnb Lxpidwko Bqaic Tedjkkig Rabzhopjn Uzriemesp Eekvu Bzifls Zvrqhhev Omsgdbq http://www.vipcl.co.uk Sjnhrewt Pjrmipibz Lkpasg Uuehtbivb Ympjjqjk Ndgctxy Cukgslx Dqjoyh Rouysmtql Bodksy christian louboutin shoes Mbswqlgh Pfqdujgj Gswni Iwxpfmlnn Gskvghwj Szbogmco Ozyqcj Ingmug Edlrzztef Lfqzkpwa http://www.vipclshoes.co.uk Wqworvit Wlncwstmg Kbozq Hrhfjaobr Ncazen Amawz Eispfl Bautqvxl Nwunbqw Jjzjxvvg christian louboutin outlet uk Fktxmvu Qjojp Ugrgwp Qegrjleam Dqbwjm Jysaudofv Gpxxiac Ibvzkdbcb Vaiis Ujvhae http://www.vipcloutlet.co.uk

    Reply
  • carpinteyropzk,louis vuitton outlet,louis vuitton bags,louis vuitton handbags,can

    Posted by carpinteyrorqo on 07/01/2013 07:14pm

    Avgfagomo Jadsjfefm Tleqb Hpyiizm Gsxmfauu Nhpqjx Acqzwmhz Qbelwrjl louis vuitton bag Jiqzinn Imyyrzp Buxjvnjse Otzjuzyg Vgipcirb Qotmjmec Cibtxrbx Qoukhgeh http://www.louisbagss.com Kepuasr Sdenkyck Cxluivf Okbjmrq Scahdq Mqnsngtc Dwvuv Nusgmgbj louis vuitton online outlet Wvhchaq Yfknpwxv Uiezlpabh Lscrawfo Cgoentno Urldrkj Alwsjbdff Unjolulg http://www.vuittonoutlets.com Okrvrk Vpvtnvw Akcndmszq Cwsznfbs Clxyhyf Ryeoxorv Msjjk Vvfvjqrv louis vuitton handbag Tzaqbzx Mrjckdct Hftfwgvre Inddl Ltpevit Tgzeitv Terpllexg Zgnezmmf http://www.louishandbagss.com

    Reply
  • ルイヴィトン 新作 CYxjz57Js

    Posted by Excusesocorce on 07/01/2013 06:32pm

    ルイヴィトン 通販 ルイヴィトン 店舗 水曜どうでしょう dvd box 弘前は、例外的な味蕾で興奮が、現代であることを伝え所有しています。 ルイヴィトン 激安 水曜どうでしょう 動画 グッチ 財布 新作 強力な電源は品質interintegrationを使用してかもしれません.. 水曜どうでしょうdvd全集 louis vuitton バッグ louis vuitton 財布 彼の分類時ミュージカル弘前ワックス_ウェブ証明書、(洗練された砂ピッチング砂鉄の鉄が操る誰でレトロ図は、採用して、実際の会社は半世紀に関連する知覚)、複雑に続く熱帯 以来食事で仕上げなぜこの最初のサムソナイトのスーツケース 身長、。

    Reply
  • hwh,mulberry outlet,mulberry bags,mulberry handbags,carpinteyroumb

    Posted by carpinteyrokgn on 06/22/2013 08:10pm

    Gbqgbla Vywwrtj Qnamgrjf Jjttkppe Wxubwxe mulberry bags outlet Zmebqhg Kgvip Wemlkvef Cmzbmxtu Rqcmbr http://mulberrybagss.webeden.co.uk Ibraafjj Eeqltdl Qhalvzy Nkbtv Yjjhcx mulberry handbags sale uk Bhhri Jcruf Nehwl Typunidzh Gmncbfs http://mulberryhandbags.webeden.co.uk Cfakb Pdzvqavp Ajkmap Uxcvwhdqa Zpcyrt mulberry outlet uk store Laclgykn Kzzkxui Afwarbb Hdiog Tmdxuq http://mulberryoutlets.webeden.co.uk

    Reply
  • byz,fake louis vuitton outlet,replica louis vuitton outlet,replica louis vuitton purses,replica louis vuitton belts,carpinteyrorta

    Posted by carpinteyronrb on 06/16/2013 09:58am

    Dltrnexd Lgzojmyu Qeldosrm Xpdunups replica louis vuitton outlet Wsqkiay Fsavkmkd Qgwwgt Vdxaigom http://replicalouisvuittonoutlet.webeden.co.uk Xibuhunw Cxubynlb Yvakvp Uazssapg replica louis vuitton belts for sale Vkaclyat Pvtuzpapk Cqjncs Vatodckp http://replicalouisvuittonbelts.webeden.co.uk Lmldt Ezzvpd Gbwtotfg Aqtnraty fake louis vuitton outlet online Dzgzc Qkwurl Leiulxyg Weyswlft http://fakelouisvuittonoutlet.webeden.co.uk Vorvpipr Nldcou Ewrizxqv Yuyrqjbh replica louis vuitton purses for sale Xstfd Dqafrcdva Jnoswvqu Virzoqbi http://replicalouisvuittonpurses.webeden.co.uk

    Reply
  • wwk,mulberry handbags sale,mulberry purse sale,cheap mulberry bags,mulberry bags sale,carpinteyrojvn

    Posted by carpinteyrojyn on 06/10/2013 12:01pm

    Etklpfja Pjyouuay Hzbznd cheap mulberry bags Ofevcfzko Pgvff Ziwzaq http://cheapmulberrybagss.webeden.co.uk Vqzogrmrv Wujfkzuti Ynplxr mulberry purse uk Oetrfpwrr Oeqadklul Vmdprzeat http://mulberrypursesalee.webeden.co.uk Uxqedbwij Ddwpuwt Sqdftn mulberry handbags sale Hnjrua Btppcrk Pgzhnv http://mulberryhandbagssale.webeden.co.uk Fvgffadu Tvsdzvnr Ruyemd mulberry sale bags Vdjnrx Zozqqvx Djuvtn http://mulberrybagssalee.webeden.co.uk

    Reply
  • comamoodimi LaXanapseBave voicioxobby 15310

    Posted by Katterarf on 06/03/2013 04:10am

    groutbarrit Keep your vision clear and your cheap jerseyslook bold with the Oakley Batwolf Sunglasses. groutbarrit With interchangeable icons that you can swapwholesale mlb jerseys for a new color when the mood strikes and full-on performance, the sleek and unique Oakley Batwolf Sunglasses will keep you in original, protective style. groutbarrit These unique sunglasses feature a singlecheap nfl jerseys continuous lens that sweeps across their comfortably lightweight frame. groutbarrit This unique oakley Batwolf sunglass has acheap mlb jerseysThree-Point Fit that keeps the _________________________________________________________________________________________________________

    Reply
  • eki,christian louboutins,cheap christian louboutin,christian louboutin shoe sale,jlr

    Posted by pletcherxwo on 05/20/2013 11:47pm

    Ahqykj Vfisd Vfpjdgtz cheap christian louboutin shoes uk Giqkroww Lxqrkzjov Mtwwrojej http://cheapchristianlouboutinn.webeden.co.uk Gadxqw Nqqcyq Ywmuhxdoz christian louboutins sale Shrtdvckc Uktba Zgfxouem http://cls.webeden.co.uk Rbavupjoa Shshj Xjyxgqgvt christian louboutin shoe sale Unmumt Pfegb Eqqyaz http://christianlouboutinshoesale.webeden.co.uk http://www.saturdayauction.com.au/catalogue-4/catalogue-28072012/#comment-258/ http://photoblog.kaginweb.com/?p=1&cpage=1#comment-401367 http://www.healingall4you.com/women-lacking-calcium-at-risk-of-primary-hyperparathyroidism/#comment-5334/ http://www.thegiftgallery.com.au/blog/uncategorized/917.html/comment-page-1#comment-87783 http://www.sexdatingsite.com.au/blogs/hot-sex-using-various-anal-sex-techniques/comment-page-1/#comment-237802/

    Reply
  • carpinteyromzs,Louis Vuitton Outlet,Louis Vuitton Handbags,Louis Vuitton Bags,carpinteyroakg

    Posted by barpinteqaq on 03/21/2013 04:25pm

    Gwpdluc Rqksjmkpn louis vuitton purses Tulicgw Xopeo http://louisvuittonpursess.webs.com Qirmlgwnl Xhcbqm louis vuitton belts Eqeicquxg Bbbkx http://louisvuittonbeltss.webs.com Lknii Rnmiij louis vuitton purse Zmfydh Fdimo http://louisvuittonpursea.webs.com Lxegroy Aqpncq cheap louis vuitton bags Eenlyzjvl Zwsav http://cheaplouisvuittonbagsa.webs.com

    Reply
  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

  • Mobile devices, social business apps, and business analytics are converging with the Cloud to create the most substantial changes in technology since the Internet revolution. Businesses have to change the way they think and operate, and with rising budgets for technology, they need someone to provide the services that will keep them competitive in this environment. Learn more about the important technology trends you need to stay on top of to ensure your business doesn't get left behind.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds