补上使用方法:
-
打开vs
-
选中房间,按alt+f1,开始挤房间
-
进入房间以后,按alt+f2停止
目前的bug:
-
有时候会弹出退出vs的窗口,这个时候请手动选择
-
必须放在桌面看的到的地方,不用置顶
下次版本预计加入功能:
-
修正bug1
-
添加个性化挤房间模式:顺序挤房间(并不针对单一房间)
-
自动升级
.h文件
- //---------------------------------------------------------------------------
- #ifndef Unit1H
- #define Unit1H
- //---------------------------------------------------------------------------
- #include <Classes.hpp>
- #include <Controls.hpp>
- #include <StdCtrls.hpp>
- #include <Forms.hpp>
- #include <ExtCtrls.hpp>
- #include "trayicon.h"
- #include <ImgList.hpp>
- #include <Menus.hpp>
- //---------------------------------------------------------------------------
- class TForm1 : public TForm
- {
- __published: // IDE-managed Components
- TTimer *Timer1;
- TTrayIcon *TrayIcon1;
- TPopupMenu *PopupMenu1;
- TImageList *ImageList1;
- TMenuItem *N1;
- TMenuItem *ALTF21;
- TMenuItem *N2;
- void __fastcall Button1Click(TObject *Sender);
- void __fastcall Timer1Timer(TObject *Sender);
- void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
- void __fastcall N1Click(TObject *Sender);
- void __fastcall ALTF21Click(TObject *Sender);
- void __fastcall FormShow(TObject *Sender);
- void __fastcall N2Click(TObject *Sender);
- private: // User declarations
- int StartHotKeyId;
- int StopHotKeyId;
- TPoint pt;
- void __fastcall HotKeyDown(TMessage &Msg);
- public: // User declarations
- __fastcall TForm1(TComponent* Owner);
- BEGIN_MESSAGE_MAP
- VCL_MESSAGE_HANDLER(WM_HOTKEY, TMessage, HotKeyDown);
- END_MESSAGE_MAP(TForm);
- };
- //---------------------------------------------------------------------------
- extern PACKAGE TForm1 *Form1;
- //---------------------------------------------------------------------------
- #endif
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
- #include "Unit1.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma link "trayicon"
- #pragma resource "*.dfm"
- TForm1 *Form1;
- //---------------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent* Owner)
- : TForm(Owner)
- {
- StartHotKeyId = GlobalAddAtom("StartVSLoader")-0xC000;
- StopHotKeyId = GlobalAddAtom("StopVSLoader")-0xC000;
- RegisterHotKey(Handle , StartHotKeyId , MOD_ALT,VK_F1);
- RegisterHotKey(Handle , StopHotKeyId , MOD_ALT,VK_F2);
- Application->ShowMainForm = false;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::HotKeyDown(TMessage &Msg)
- {
- if( (Msg.LParamLo == MOD_ALT)&& (Msg.LParamHi == VK_F1) ){
- Timer1->Enabled = true;
- TrayIcon1->Animate = true;
- GetCursorPos(&pt);
- }
- if( (Msg.LParamLo == MOD_ALT)&& (Msg.LParamHi == VK_F2) ){
- Timer1->Enabled = false;
- TrayIcon1->Animate = false;
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Button1Click(TObject *Sender)
- {
- //HWND listview = FindWindow(NULL, "VS竞技游戏平台");//
- //TPoint pt;
- //GetCursorPos(&pt);
- Timer1->Enabled = true;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Timer1Timer(TObject *Sender)
- {
- Timer1->Enabled = false;
- TPoint tmp;
- GetCursorPos(&tmp);
- SetCursorPos(pt.x,pt.y);
- HWND win = NULL;
- win =FindWindow(NULL, "VS竞技游戏平台");
- if(win){
- keybd_event(VK_ESCAPE ,0,KEYEVENTF_EXTENDEDKEY | 0,0 );
- keybd_event(VK_ESCAPE ,0,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,0);
- }
- win =FindWindow(NULL, "VSClient");
- if(win){
- keybd_event(VK_ESCAPE ,0,KEYEVENTF_EXTENDEDKEY | 0,0 );
- keybd_event(VK_ESCAPE ,0,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,0);
- }
- if(win == NULL){
- mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
- mouse_event(MOUSEEVENTF_LEFTUP ,0,0,0,0);
- //bug001::现在vs版本对应
-
- mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
- mouse_event(MOUSEEVENTF_LEFTUP ,0,0,0,0);
- //bug001::end
- }
- SetCursorPos(tmp.x, tmp.y);
- Timer1->Enabled = true;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
- {
- UnregisterHotKey(Handle , StartHotKeyId);
- UnregisterHotKey(Handle , StopHotKeyId);
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::N1Click(TObject *Sender)
- {
- Timer1->Enabled = true;
- TrayIcon1->Animate = true;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::ALTF21Click(TObject *Sender)
- {
- Timer1->Enabled = false;
- TrayIcon1->Animate = false;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::FormShow(TObject *Sender)
- {
- TrayIcon1->Minimize();
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::N2Click(TObject *Sender)
- {
- Close();
- }
- //---------------------------------------------------------------------------
代码和可执行文件下载地址:http://download.csdn.net/source/567156