<?xml version="1.0" encoding="windows-1251"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Форум программистов - Win Api</title>
		<link>http://www.programmersforum.ru/</link>
		<description />
		<language>ru</language>
		<lastBuildDate>Sat, 04 Sep 2010 01:26:00 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>10</ttl>
		<image>
			<url>http://programmersforum.ru/images/1070/misc/rss.jpg</url>
			<title>Форум программистов - Win Api</title>
			<link>http://www.programmersforum.ru/</link>
		</image>
		<item>
			<title>Как нажать на кнопку в программе.</title>
			<link>http://www.programmersforum.ru/showthread.php?t=112079&amp;goto=newpost</link>
			<pubDate>Fri, 03 Sep 2010 13:26:04 GMT</pubDate>
			<description>Вопросы уже задавались, но проблема такая: 
 
Имеется несколько ОТКРЫТЫХ программ. В каждой программе должна нажиматься кнопка СТАРТ, по окончанию...</description>
			<content:encoded><![CDATA[<div>Вопросы уже задавались, но проблема такая:<br />
<br />
Имеется несколько ОТКРЫТЫХ программ. В каждой программе должна нажиматься кнопка СТАРТ, по окончанию работы предыдущей. Запускать все в ручную надоело - каждая программа до окончания действия работает по 1 часу примерно. Т.е, указываешь время работы, путь к файлам .exe (Если это возможно, то именно путь). Программа сначала нажимает кнопку СТАРТ у одной из программ, по истечению таймаута (скажем 1 час, когда первая программа закончит работу) нажимает СТАРТ у второй программы и т.д. Как это все организовать?<br />
<br />
Вид программ:<br />
<img src="http://s46.radikal.ru/i111/1009/40/12a666c72664.png" border="0" alt="" /><br />
<br />
Язык программирования, с которым работаю - Delphi.</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=4">Win Api</category>
			<dc:creator>arach</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=112079</guid>
		</item>
		<item>
			<title>SPY++  и Дискриптор</title>
			<link>http://www.programmersforum.ru/showthread.php?t=111861&amp;goto=newpost</link>
			<pubDate>Wed, 01 Sep 2010 11:57:23 GMT</pubDate>
			<description>Народ может кто знает, сталкивался.. Помогите 
Есть функция FindWindow() которая ищет окно и возвращает его дискриптор, принимает имя класса окна и...</description>
			<content:encoded><![CDATA[<div>Народ может кто знает, сталкивался.. Помогите<br />
Есть функция FindWindow() которая ищет окно и возвращает его дискриптор, принимает имя класса окна и его заголовок...допустим на примере с калькулятором...(Писали программу для изменения стандарных надписей на 1 запуск - нужно было найти окно и  получить его дискриптор и измнять надпись)<br />
<br />
HWND h1 = FindWindow(TEXT(&quot;CalcFrame&quot;), TEXT(&quot;Калькулятор&quot;));<br />
<br />
Тут все норм - открыли Spy++ получили значения класса и заголовка вбили в код, и потом<br />
<br />
SetWindowText(h1,L&quot;Новое имя калькулятора&quot;);<br />
<br />
тут все работает норм..<br />
<br />
но решил изменить надписи на кнопках и тут попал в залет<br />
1) такк же запустил  Spy++<br />
2) Класс в принципе у всех кнопок один и тот же это логично(Button), а вот заголовок окна там не прописывается...тоесть выхватить дискриптор я не могу...(Стоит Винда 7(в икпи  заголовки есть))Хитро))<br />
пытался взять сразу дискриптор через спай++<br />
<br />
присвоил его и вбил - надпись то изменилась - но дискриптор меняется при каждом запуске )) так это вот так вот..<br />
<br />
можно ли как то его получать еще???</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=4">Win Api</category>
			<dc:creator>daruwanov</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=111861</guid>
		</item>
		<item>
			<title>Отправка ел. писем</title>
			<link>http://www.programmersforum.ru/showthread.php?t=111776&amp;goto=newpost</link>
			<pubDate>Tue, 31 Aug 2010 11:00:03 GMT</pubDate>
			<description>Подскажите как с помощу апи отправлять ел. письма. гугл юзаю и с инди знаком, но мне нужно алгоритм отправки без виз. компонентов. 
 
P.S. и ищо,...</description>
			<content:encoded><![CDATA[<div>Подскажите как с помощу апи отправлять ел. письма. гугл юзаю и с инди знаком, но мне нужно алгоритм отправки без виз. компонентов.<br />
<br />
P.S. и ищо, никто не знает как програмно подключить инет?</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=4">Win Api</category>
			<dc:creator>legendary</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=111776</guid>
		</item>
		<item>
			<title>Получение списка процеcсов</title>
			<link>http://www.programmersforum.ru/showthread.php?t=111659&amp;goto=newpost</link>
			<pubDate>Mon, 30 Aug 2010 09:42:28 GMT</pubDate>
			<description>код: 
 
Код: 
--------- 
var 
  h,hp: THandle; 
  p: PROCESSENTRY32; 
  pid: integer; 
begin 
h:= CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);</description>
			<content:encoded><![CDATA[<div>код:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Код:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">var<br />
&nbsp; h,hp: THandle;<br />
&nbsp; p: PROCESSENTRY32;<br />
&nbsp; pid: integer;<br />
begin<br />
h:= CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);<br />
if h=-1 then exit;<br />
if Process32First(h,p) then&nbsp;  // либо здесь false<br />
&nbsp;repeat<br />
&nbsp; if p.szExeFile='notepad.exe' then break;<br />
&nbsp;until not process32next(h,p)<br />
else exit;<br />
if p.th32ProcessID = 0 then exit;<br />
pid:= p.th32ProcessID;&nbsp;  // при трасеровке F7 даную строку прчемуто пропускает а если и не пропускает то вирубает на TerminateProcess<br />
hp:= OpenProcess(PROCESS_TERMINATE, true, pid);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
TerminateProcess(hp,0);&nbsp; //&nbsp; либо здесь вирубает как будь то снимает сама себя&nbsp; &nbsp; &nbsp; &nbsp; <br />
closehandle(h);<br />
closehandle(hp);<br />
end;</code><hr />
</div>GetLastError показывает 'Runtime error 216 at 7E378944'<br />
<br />
Почему даная процедура по событию OnClick работает отлично, а когда ее использовать в dll или Source с постоянним оновлениям то она исполняется только раз либо вобще не работает?????????? <br />
<br />
для умников: з асм знаком но только на уровне написаныя небольших прог а не откладки кода</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=4">Win Api</category>
			<dc:creator>legendary</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=111659</guid>
		</item>
		<item>
			<title>Запуск програмы в Windows XP</title>
			<link>http://www.programmersforum.ru/showthread.php?t=111304&amp;goto=newpost</link>
			<pubDate>Thu, 26 Aug 2010 14:14:54 GMT</pubDate>
			<description>Ставлю в автозагрузку 2 программки. Стартует Windows XP, и эти програмки запускаются по очереди в одно и тоже место рабочего стола (одна поверх...</description>
			<content:encoded><![CDATA[<div>Ставлю в автозагрузку 2 программки. Стартует Windows XP, и эти програмки запускаются по очереди в одно и тоже место рабочего стола (одна поверх другой). В ручную перетаскиваю их вправо и влево, но при перезагрузке они опять открываются одна поверх другой. Как сделать чтобы при загрузке Windows они открывались одна справа, другая слева на мониторе?<br />
<br />
<br />
Эта программа с разными настройками СОМ порта.</div>


	<br />
	<div style="padding:8px">

	

	

	

	
		<fieldset class="fieldset">
			<legend>Вложения</legend>
			<table cellpadding="0" cellspacing="3" border="0">
			<tr>
	<td><img class="inlineimg" src="http://www.programmersforum.ru/images/1070/attach/rar.gif" alt="Тип файла: rar" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
	<td><a href="http://www.programmersforum.ru/attachment.php?attachmentid=29173&amp;d=1282831988">ATON-K Monitor Demo.rar</a> (453.5 Кб)</td>
</tr>
			</table>
		</fieldset>
	

	</div>
]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=4">Win Api</category>
			<dc:creator>nva2710</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=111304</guid>
		</item>
		<item>
			<title>Эмуляция нажатия клавиш в свернутом окне на уровне драйвера</title>
			<link>http://www.programmersforum.ru/showthread.php?t=111281&amp;goto=newpost</link>
			<pubDate>Thu, 26 Aug 2010 10:47:29 GMT</pubDate>
			<description>Всем привет. Помогите, пожалуйста, с такой вот задачей. Есть код на C++, который осуществляет успешную отправку клавиш в свернутое приложение. 
Код...</description>
			<content:encoded><![CDATA[<div>Всем привет. Помогите, пожалуйста, с такой вот задачей. Есть код на C++, который осуществляет успешную отправку клавиш в свернутое приложение.<br />
Код отсылает клавиши 1 и 2 по очереди с перерывом в 3 секунды.<br />
<br />
Вопрос: как сделать так, чтоб осуществлялось это через ПОЛНУЮ эмуляцию нажатия на кнопки клавиатуры, т.е на уровне драйвера?<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Код:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">#include &lt;windows.h&gt;<br />
#include &lt;windowsx.h&gt;<br />
#include &lt;stdlib.h&gt;<br />
#include &lt;stdio.h&gt;<br />
<br />
HWND&nbsp; &nbsp; &nbsp; g_hWnd&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = NULL;<br />
HWND&nbsp; &nbsp; &nbsp; wowWND&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = NULL;<br />
bool&nbsp; &nbsp; &nbsp; actFlag&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  = false;<br />
bool&nbsp; &nbsp; &nbsp; key&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  = false;<br />
<br />
HRESULT InitWindow(HINSTANCE hInstance, int nCmdShow);<br />
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);<br />
<br />
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  LPSTR lpCmdLine, int nCmdShow)<br />
{<br />
<br />
&nbsp; if (FAILED(InitWindow(hInstance, nCmdShow)))<br />
&nbsp; &nbsp; return 0;<br />
<br />
&nbsp; SetTimer(g_hWnd, 1, 3000, NULL);<br />
&nbsp; MSG msg = {0};<br />
&nbsp; while (GetMessage(&amp;msg, NULL, 0, 0))<br />
&nbsp; {<br />
&nbsp; &nbsp; TranslateMessage(&amp;msg);<br />
&nbsp; &nbsp; DispatchMessage(&amp;msg);<br />
&nbsp; }<br />
&nbsp; <br />
&nbsp; KillTimer(g_hWnd, 1);<br />
<br />
&nbsp; return (int) msg.wParam;<br />
}<br />
<br />
HRESULT InitWindow(HINSTANCE hInstance, int nCmdShow)<br />
{<br />
&nbsp; // register window class<br />
&nbsp; WNDCLASSEX wc;<br />
&nbsp; wc.cbSize&nbsp; &nbsp; &nbsp; &nbsp;  = sizeof(WNDCLASSEX);<br />
&nbsp; wc.style&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = CS_HREDRAW|CS_VREDRAW;<br />
&nbsp; wc.lpfnWndProc&nbsp; &nbsp; = WndProc;<br />
&nbsp; wc.cbClsExtra&nbsp; &nbsp;  = 0;<br />
&nbsp; wc.cbWndExtra&nbsp; &nbsp;  = 0;<br />
&nbsp; wc.hInstance&nbsp; &nbsp; &nbsp; = hInstance;<br />
&nbsp; wc.hIcon&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = LoadIcon(NULL, IDI_APPLICATION);<br />
&nbsp; wc.hCursor&nbsp; &nbsp; &nbsp; &nbsp; = LoadCursor(NULL, IDC_ARROW);<br />
&nbsp; wc.hbrBackground&nbsp; = (HBRUSH)(COLOR_WINDOW + 1);<br />
&nbsp; wc.lpszMenuName&nbsp;  = NULL;<br />
&nbsp; wc.lpszClassName&nbsp; = L&quot;SimpleWindowClass&quot;;<br />
&nbsp; wc.hIconSm&nbsp; &nbsp; &nbsp; &nbsp; = LoadIcon(NULL, IDI_APPLICATION);<br />
<br />
&nbsp; if (!RegisterClassEx(&amp;wc))<br />
&nbsp; &nbsp; return E_FAIL;<br />
<br />
&nbsp; // create window<br />
&nbsp; g_hWnd = CreateWindow(<br />
&nbsp; &nbsp; L&quot;SimpleWindowClass&quot;,<br />
&nbsp; &nbsp; L&quot;Поиск путей Bug2&quot;,<br />
&nbsp; &nbsp; WS_OVERLAPPEDWINDOW,<br />
&nbsp; &nbsp; CW_USEDEFAULT,<br />
&nbsp; &nbsp; CW_USEDEFAULT,<br />
&nbsp; &nbsp; 640,<br />
&nbsp; &nbsp; 480,<br />
&nbsp; &nbsp; NULL,<br />
&nbsp; &nbsp; NULL,<br />
&nbsp; &nbsp; hInstance,<br />
&nbsp; &nbsp; NULL);<br />
<br />
&nbsp; if (!g_hWnd)<br />
&nbsp; &nbsp; return E_FAIL;<br />
<br />
&nbsp; //ShowWindow(g_hWnd, nCmdShow);<br />
<br />
&nbsp; //UpdateWindow(g_hWnd);<br />
<br />
&nbsp; return S_OK;<br />
}<br />
<br />
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)<br />
{<br />
&nbsp; switch (message)<br />
&nbsp; {<br />
<br />
&nbsp; case WM_DESTROY:<br />
&nbsp; &nbsp; PostQuitMessage(0);<br />
&nbsp; &nbsp; break;<br />
<br />
&nbsp; case WM_TIMER:<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; if (!wowWND)<br />
&nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; wowWND = FindWindow(NULL, L&quot;World of Warcraft&quot;);<br />
&nbsp; &nbsp; &nbsp; if (wowWND)<br />
&nbsp; &nbsp; &nbsp; &nbsp; actFlag = true;<br />
&nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; wowWND = FindWindow(NULL, L&quot;Wow&quot;);<br />
<br />
&nbsp; &nbsp; &nbsp; if (wowWND)<br />
&nbsp; &nbsp; &nbsp; &nbsp; actFlag = true;<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; if (actFlag)<br />
&nbsp; &nbsp; &nbsp; if (key)<br />
&nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; SendMessage(wowWND, WM_CHAR, '1', 0);<br />
&nbsp; &nbsp; &nbsp; &nbsp; key = false;<br />
&nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; SendMessage(wowWND, WM_CHAR, '2', 0);<br />
&nbsp; &nbsp; &nbsp; &nbsp; key = true;<br />
&nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; break;<br />
<br />
&nbsp; default:<br />
&nbsp; &nbsp; return DefWindowProc(hWnd, message, wParam, lParam);<br />
&nbsp; }<br />
&nbsp; return 0;<br />
}</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=4">Win Api</category>
			<dc:creator>Razlo</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=111281</guid>
		</item>
		<item>
			<title>ShellExecute</title>
			<link>http://www.programmersforum.ru/showthread.php?t=111270&amp;goto=newpost</link>
			<pubDate>Thu, 26 Aug 2010 09:06:21 GMT</pubDate>
			<description>Всем привет! 
Такая проблема. 
Функцией ShellExecute копирую n-ое количество файлов из одного места в другое. 
Но при копировании, в конечной папке,...</description>
			<content:encoded><![CDATA[<div>Всем привет!<br />
Такая проблема.<br />
Функцией ShellExecute копирую n-ое количество файлов из одного места в другое.<br />
Но при копировании, в конечной папке, может уже быть один из файлов. Если он есть, то как это узнать и соответственно выдать сообщение заменять его или нет?<br />
Код: a := ShellExecute(Application.Handle, 'open', 'xcopy', 'd:\123\1\*.txt d:\123\2 /-y', nil, 5); //   /-y - это запрос на перезапись файла в командной строке.</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=4">Win Api</category>
			<dc:creator>frodo-94</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=111270</guid>
		</item>
		<item>
			<title>Файлы отображаемые в память</title>
			<link>http://www.programmersforum.ru/showthread.php?t=111039&amp;goto=newpost</link>
			<pubDate>Tue, 24 Aug 2010 10:36:06 GMT</pubDate>
			<description>Добрый день. Я в своей программе использую функции CreateFile,CreateFileMapping,MapViewOfFile для ускорения чтения из файлов большого размера.Я...</description>
			<content:encoded><![CDATA[<div>Добрый день. Я в своей программе использую функции CreateFile,CreateFileMapping,MapVie  wOfFile для ускорения чтения из файлов большого размера.Я открывал файл размером 3гб и мне удавалось по частям отображать его в память процесса, максимальный размер отображения получался около 500 мб. Чтобы моя программа могла работать на разных машинах мне необходимо в программе определять максимальный размер отображения функцией MapViewOfFile для данной машины и затем по частям отображать файл в память процесса и там работать с ним. Подскажите как это можно сделать и от чего зависит максимальный размер отображения функцией MapViewOfFile.</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=4">Win Api</category>
			<dc:creator>HollyPaladin</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=111039</guid>
		</item>
		<item>
			<title>Хук CreateFile x64</title>
			<link>http://www.programmersforum.ru/showthread.php?t=110979&amp;goto=newpost</link>
			<pubDate>Tue, 24 Aug 2010 01:50:25 GMT</pubDate>
			<description><![CDATA[Есть код на ObjectPascal (Delphi) компилируемый в FPC (из-под Lazarus'a) в dll x64. После запуска тестовой проги все процессы просто завершаются с...]]></description>
			<content:encoded><![CDATA[<div>Есть код на ObjectPascal (Delphi) компилируемый в FPC (из-под Lazarus'a) в dll x64. После запуска тестовой проги все процессы просто завершаются с ошибкой в kernel32 (там CreateFileW находится).<br />
Вот код dll:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Код:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">library HookDriveCore;<br />
<br />
uses<br />
&nbsp; Windows;<br />
<br />
{$mode delphi}<br />
<br />
type<br />
&nbsp; CreateFileWHookRecord = packed record<br />
&nbsp; &nbsp; PushOperation: byte;<br />
&nbsp; &nbsp; Argument: Pointer;<br />
&nbsp; &nbsp; ReturnOperation: byte;<br />
&nbsp; end;<br />
<br />
&nbsp; PObjectAttributes = ^TObjectAttributes;<br />
&nbsp; TObjectAttributes = packed record<br />
&nbsp; &nbsp; Length: DWORD;<br />
&nbsp; &nbsp; RootDirectory: THandle;<br />
&nbsp; &nbsp; ObjectName: PChar;<br />
&nbsp; &nbsp; Attributes: DWORD;<br />
&nbsp; &nbsp; SecurityDescriptor: Pointer;<br />
&nbsp; &nbsp; SecurityQualityOfService: Pointer;<br />
&nbsp; end;<br />
<br />
var<br />
&nbsp; hGlobalHook: cardinal;<br />
&nbsp; CreateFileWBackup, CreateFileWHook: CreateFileWHookRecord;<br />
&nbsp; CreateFileW: function(lpFileName:LPCWSTR;<br />
&nbsp;dwDesiredAccess:DWORD;<br />
&nbsp;dwShareMode:DWORD;<br />
&nbsp;lpSecurityAttributes:LPSECURITY_ATTRIBUTES;<br />
&nbsp;dwCreationDisposition:DWORD;<br />
&nbsp;dwFlagsAndAttributes:DWORD;<br />
&nbsp;hTemplateFile:HANDLE):HANDLE; stdcall;<br />
<br />
const MutexName: LPSTR = 'Elysium_HookDrive_Mutex';<br />
<br />
function HookCreateFileW(lpFileName:LPCWSTR;<br />
&nbsp;dwDesiredAccess:DWORD;<br />
&nbsp;dwShareMode:DWORD;<br />
&nbsp;lpSecurityAttributes:LPSECURITY_ATTRIBUTES;<br />
&nbsp;dwCreationDisposition:DWORD;<br />
&nbsp;dwFlagsAndAttributes:DWORD;<br />
&nbsp;hTemplateFile:HANDLE):HANDLE; stdcall;<br />
var<br />
&nbsp; WrittedBytes: dWord;<br />
begin<br />
&nbsp; MessageBox(0, 'A', '', 0); // Проверка хука<br />
&nbsp; WriteProcessMemory(INVALID_HANDLE_VALUE,<br />
&nbsp;  @CreateFileW,<br />
&nbsp;  @CreateFileWBackup,<br />
&nbsp;  sizeof(CreateFileWHookRecord),<br />
&nbsp;  WrittedBytes);<br />
&nbsp; Result := CreateFileW(lpFileName,<br />
&nbsp;  dwDesiredAccess,<br />
&nbsp;  dwShareMode,<br />
&nbsp;  lpSecurityAttributes,<br />
&nbsp;  dwCreationDisposition,<br />
&nbsp;  dwFlagsAndAttributes,<br />
&nbsp;  hTemplateFile);<br />
&nbsp; WriteProcessMemory(INVALID_HANDLE_VALUE,<br />
&nbsp;  @CreateFileW,<br />
&nbsp;  @CreateFileWHook,<br />
&nbsp;  sizeof(CreateFileWHookRecord),<br />
&nbsp;  WrittedBytes);<br />
end;<br />
<br />
procedure SetHook();<br />
var<br />
&nbsp; hkernel32: dWord;<br />
&nbsp; WrittedBytes: dWord;<br />
&nbsp; OldProtect: dWord;<br />
begin<br />
&nbsp; hkernel32 := GetModuleHandle('kernel32.dll');<br />
&nbsp; CreateFileW := GetProcAddress(hkernel32, 'CreateFileW');<br />
&nbsp; ReadProcessMemory(INVALID_HANDLE_VALUE,<br />
&nbsp;  @CreateFileW,<br />
&nbsp;  @CreateFileWBackup,<br />
&nbsp;  sizeof(CreateFileWHookRecord),<br />
&nbsp;  WrittedBytes);<br />
&nbsp; with CreateFileWHook do<br />
&nbsp; begin<br />
&nbsp; &nbsp; PushOperation := $68;<br />
&nbsp; &nbsp; Argument := @HookCreateFileW;<br />
&nbsp; &nbsp; ReturnOperation := $C3;<br />
&nbsp; end;<br />
&nbsp; VirtualProtectEx(INVALID_HANDLE_VALUE,<br />
&nbsp;  @CreateFileW,<br />
&nbsp;  sizeof(CreateFileWHookRecord),<br />
&nbsp;  PAGE_EXECUTE_READWRITE,<br />
&nbsp;  @OldProtect);<br />
&nbsp; WriteProcessMemory(INVALID_HANDLE_VALUE,<br />
&nbsp;  @CreateFileW,<br />
&nbsp;  @CreateFileWHook,<br />
&nbsp;  sizeof(CreateFileWHookRecord),<br />
&nbsp;  WrittedBytes);<br />
end;<br />
<br />
procedure UnHook();<br />
var<br />
&nbsp; WrittedBytes: dWord;<br />
begin<br />
&nbsp; WriteProcessMemory(INVALID_HANDLE_VALUE,<br />
&nbsp;  @CreateFileW,<br />
&nbsp;  @CreateFileWBackup,<br />
&nbsp;  sizeof(CreateFileWHookRecord),<br />
&nbsp;  WrittedBytes);<br />
end;<br />
<br />
function MessageProc(code: integer; wParam: word; lParam: longint): longint; stdcall;<br />
begin<br />
&nbsp; Result := CallNextHookEx(0, code, wParam, lParam);<br />
end;<br />
<br />
procedure SetGlobalHookProc();<br />
begin<br />
&nbsp; hGlobalHook := SetWindowsHookEx(WH_GETMESSAGE, @MessageProc, HInstance, 0);<br />
&nbsp; Sleep(Infinite);<br />
end;<br />
<br />
procedure SetGlobalHook();<br />
var<br />
&nbsp; hMutex: dWord;<br />
&nbsp; ThreadId: dWord;<br />
begin<br />
&nbsp; hMutex := CreateMutex(nil, false, MutexName);<br />
&nbsp; if GetLastError = 0 then<br />
&nbsp; &nbsp; CreateThread(nil, 0, @SetGlobalHookProc, nil, 0, ThreadId)<br />
&nbsp; else<br />
&nbsp; &nbsp; CloseHandle(hMutex);<br />
end;<br />
<br />
procedure GlobalUnHook();<br />
begin<br />
&nbsp; if hGlobalHook &lt;&gt; 0 then<br />
&nbsp; &nbsp; UnHookWindowsHookEx(hGlobalHook);<br />
end;<br />
<br />
function DllProcessAttach(dwReason: longint): longbool;<br />
begin<br />
&nbsp; SetGlobalHook();<br />
&nbsp; SetHook();<br />
&nbsp; Result := True;<br />
end;<br />
<br />
procedure DllProcessDetach(dwReason: longint);<br />
begin<br />
&nbsp; GlobalUnHook();<br />
&nbsp; UnHook();<br />
end;<br />
<br />
{$IFDEF WINDOWS}{$R HookDriveCore.rc}{$ENDIF}<br />
<br />
begin<br />
&nbsp; DllProcessAttach(DLL_PROCESS_ATTACH);<br />
&nbsp; DLL_Process_Detach_Hook := @DllProcessDetach;<br />
end.</code><hr />
</div>И код программы:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Код:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">program HookDriveCoreTest;<br />
<br />
uses Windows;<br />
<br />
begin<br />
&nbsp; LoadLibrary('HookDriveCore.dll');<br />
&nbsp; Sleep(Infinite);<br />
end.</code><hr />
</div>Собственно, найдите ошибку :d</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=4">Win Api</category>
			<dc:creator>Alex217Vish</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=110979</guid>
		</item>
		<item>
			<title>Решение задачи со временем</title>
			<link>http://www.programmersforum.ru/showthread.php?t=110973&amp;goto=newpost</link>
			<pubDate>Mon, 23 Aug 2010 22:05:34 GMT</pubDate>
			<description>Задача в том, что бы по прошествию 15 секунд изменять системное время на 14 секунд обратно)) не нашел аналогов на форумах, прошу помогите пожалуйста...</description>
			<content:encoded><![CDATA[<div>Задача в том, что бы по прошествию 15 секунд изменять системное время на 14 секунд обратно)) не нашел аналогов на форумах, прошу помогите пожалуйста :)</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=4">Win Api</category>
			<dc:creator>LiNeR70</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=110973</guid>
		</item>
		<item>
			<title>приложение к которому могут добавляться  файлы</title>
			<link>http://www.programmersforum.ru/showthread.php?t=110901&amp;goto=newpost</link>
			<pubDate>Mon, 23 Aug 2010 07:10:25 GMT</pubDate>
			<description>Я не знаю как создать такое приложение, в которое  можно добавлять файлы перенося их на область формы. 
Даже не знаю что искать, посоветуйте...</description>
			<content:encoded><![CDATA[<div>Я не знаю как создать такое приложение, в которое  можно добавлять файлы перенося их на область формы.<br />
Даже не знаю что искать, посоветуйте литературу или, что поискать в google. :confused:</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=4">Win Api</category>
			<dc:creator>wanes101</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=110901</guid>
		</item>
		<item>
			<title>Даже не знаю в чем проблема</title>
			<link>http://www.programmersforum.ru/showthread.php?t=110760&amp;goto=newpost</link>
			<pubDate>Sat, 21 Aug 2010 15:05:31 GMT</pubDate>
			<description><![CDATA[Люди добрые помогите. Пишу программу, в голове уже каша) 
В программе есть TabControl с двумя вкладками. На в кладках по ListBox'у. 
В ЛистБокс...]]></description>
			<content:encoded><![CDATA[<div>Люди добрые помогите. Пишу программу, в голове уже каша)<br />
В программе есть TabControl с двумя вкладками. На в кладках по ListBox'у.<br />
В ЛистБокс выводятся данные из файла. Проблема в том, что при первом запуске<br />
сразу активирована 1-я вкладка, после чего перехожу на 2-ую (появляется текст в 4 колонки),<br />
потом перехожу на 1-ую вкладку и снова на 2-ую, В итоге в ЛистБоксе тот же текст<br />
только в двух экземплярах. Остальные попытки смены вкладок текст больше не добавляют.<br />
Привожу исходники основных функций. Компилятор MS Visual 2008.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Код:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">void InitControl(HWND hWnd, HINSTANCE hInstance, int idpage)<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; DWORD buffer;<br />
&nbsp; &nbsp; &nbsp; &nbsp; wchar_t lpBuffer[100]={0};<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; hFile = CreateFile (L&quot;rasxod.txt&quot;, GENERIC_READ, NULL, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; if(idpage==0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ListView = CreateWindow(WC_LISTVIEW, L&quot;LISTVIEW&quot;,WS_VISIBLE|WS_CHILD|WS_BORDER|LVS_REPORT|LVS_EDITLABELS|<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WS_VSCROLL|WS_BORDER|WS_HSCROLL|WS_CLIPCHILDREN|WS_CLIPSIBLINGS,rect.left, rect.top, x, <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; y-y/4,hWnd1, (HMENU)ID_LISTVIEW, hInstance, 0);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddColumnToListView(ListView, L&quot;№&quot;,1,40);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddColumnToListView(ListView, L&quot;Наименование&quot;,2,300);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddColumnToListView(ListView, L&quot;Кол-во&quot;,3,100);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddColumnToListView(ListView, L&quot;Цена&quot;,4,100);&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int size = GetFileSize( hFile, 0 );<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ReadFile(hFile, lpBuffer, size, &amp;buffer, NULL);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EditBuffer(lpBuffer);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CloseHandle(hFile);&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; if(idpage==1)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ListView1 = CreateWindow(WC_LISTVIEW, L&quot;LISTVIEW&quot;,WS_VISIBLE|WS_CHILD|WS_BORDER|LVS_REPORT|LVS_EDITLABELS|<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WS_VSCROLL|WS_BORDER|WS_HSCROLL|WS_CLIPCHILDREN|WS_CLIPSIBLINGS,rect.left, rect.top, x, <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; y-y/4,hWnd2, (HMENU)ID_LISTVIEW1, hInstance, 0);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddColumnToListView(ListView1, L&quot;№&quot;,1,40);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddColumnToListView(ListView1, L&quot;Наименование&quot;,2,300);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddColumnToListView(ListView1, L&quot;Кол-во&quot;,3,100);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddColumnToListView(ListView1, L&quot;Цена&quot;,4,100);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int size = GetFileSize( hFile, 0 );<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ReadFile(hFile, lpBuffer, size, &amp;buffer, NULL);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EditBuffer(lpBuffer);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CloseHandle(hFile);<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
}</code><hr />
</div><div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Код:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">void EditBuffer(wchar_t lpBuffer[100])<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; int count = 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; int count1 = 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; int temp = 0;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; for(int i = 0; i &lt; 100; i++)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lpBuffer[i] = lpBuffer[i+1];<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //if(lpBuffer[i] == TAB2)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // #define TAB2 L'013'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //MessageBox(0, L&quot;1&quot;, L&quot;&quot;, MB_OK);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; for(int i = 0; i &lt; 100; i++)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(count == 0 &amp;&amp; lpBuffer[i]==TAB1)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // #define TAB1 L'\n'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for(int n = 0; n &lt; i-temp-1; n++)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //MessageBox(0, L&quot;1&quot;, L&quot;&quot;, MB_OK);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; numberBuffer[n] = lpBuffer[n+temp];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; temp = i+1;&nbsp; //3<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; count++;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i = i+1;&nbsp; //3<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(count == 1 &amp;&amp; lpBuffer[i]==TAB1)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for(int n = 0; n &lt; i-temp-1; n++)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nameBuffer[n] = lpBuffer[n+temp];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; temp = i+1;&nbsp; //10<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; count++;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i = i+1;&nbsp; //10<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(count == 2)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddItemToListView(ListView1, numberBuffer, count1, 0);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddItemToListView(ListView1, nameBuffer, count1, 1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddItemToListView(ListView1, amountBuffer, count1, 2);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddItemToListView(ListView1, priceBuffer, count1, 3);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; count = 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; count1++;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; memset(&amp;numberBuffer, NULL, 100);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; memset(&amp;nameBuffer, NULL, 100);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; memset(&amp;amountBuffer, NULL, 100);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; memset(&amp;priceBuffer, NULL, 100);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
}</code><hr />
</div><div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Код:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">LRESULT __stdcall WndProc(HWND hWnd, UINT msg, WPARAM wparam, LPARAM lparam)<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; HDC hDC;<br />
&nbsp; &nbsp; &nbsp; &nbsp; PAINTSTRUCT ps;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; switch(msg)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; case WM_NOTIFY:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NMHDR *ptab = (LPNMHDR) lparam;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LPTOOLTIPTEXT lpToolTipText;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switch(ptab-&gt;code)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case TTN_NEEDTEXT:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lpToolTipText = (LPTOOLTIPTEXT) lparam;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case TCN_SELCHANGE:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; idpage = TabCtrl_GetCurSel(ptab-&gt;hwndFrom);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShowWindow(hWnd1, SW_HIDE);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShowWindow(hWnd2, SW_HIDE);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switch(idpage)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 0:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //MessageBox(0,L&quot;0&quot;,L&quot;&quot;,MB_OK);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; InitControl(hWnd, hInstance, 0);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShowWindow(hWnd1, SW_SHOW);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 1:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //MessageBox(0,L&quot;1&quot;,L&quot;&quot;,MB_OK);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; InitControl(hWnd, hInstance, 1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShowWindow(hWnd2, SW_SHOW);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; case WM_PAINT:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hDC=BeginPaint(hWnd, &amp;ps);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; InvalidateRect(tab, 0, true);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EndPaint(hWnd, &amp;ps);//освоб. контекст устройства<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br />
&nbsp; &nbsp; &nbsp; &nbsp; case WM_DESTROY:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PostQuitMessage(0);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; default:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return DefWindowProc(hWnd, msg, wparam, lparam);<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; return 0;<br />
}</code><hr />
</div>Еще InitControl() вызывается 1 раз в WinMain перед ShowWindow().</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=4">Win Api</category>
			<dc:creator>DeFace</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=110760</guid>
		</item>
		<item>
			<title>Зачитать заголовок формы владельца из длл</title>
			<link>http://www.programmersforum.ru/showthread.php?t=110608&amp;goto=newpost</link>
			<pubDate>Thu, 19 Aug 2010 21:59:05 GMT</pubDate>
			<description>Привет. 
 
Есть программа стороннего разработчика, которая подключает длл, как плагины. 
 
Когда мою длл подключают, приложение вызывает функцию...</description>
			<content:encoded><![CDATA[<div>Привет.<br />
<br />
Есть программа стороннего разработчика, которая подключает длл, как плагины.<br />
<br />
Когда мою длл подключают, приложение вызывает функцию MyDll_Init()<br />
без параметров.<br />
<br />
Как мне внутри этой процедуры (с самой длл) узнать текст заголовка (Caption) главного окна приложения, которое эту длл вызвало.<br />
<br />
Мне необходимо его зачитать, т.к. там записан уникальный номер пользователя. И мне его необходимо узнать, для дальнейшей работы.</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=4">Win Api</category>
			<dc:creator>esmaster</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=110608</guid>
		</item>
		<item>
			<title>UnlockFile как правильно ?</title>
			<link>http://www.programmersforum.ru/showthread.php?t=110392&amp;goto=newpost</link>
			<pubDate>Tue, 17 Aug 2010 23:18:23 GMT</pubDate>
			<description>Работаю с файловой системей и возникла пробелма в том что пишет мол файл занят другим процессом и т.д. - как снять правельно блокировку. А то в инете...</description>
			<content:encoded><![CDATA[<div>Работаю с файловой системей и возникла пробелма в том что пишет мол файл занят другим процессом и т.д. - как снять правельно блокировку. А то в инете примеров ненашел вовсе</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=4">Win Api</category>
			<dc:creator>kakawkin</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=110392</guid>
		</item>
		<item>
			<title>PE файлы</title>
			<link>http://www.programmersforum.ru/showthread.php?t=110246&amp;goto=newpost</link>
			<pubDate>Mon, 16 Aug 2010 12:18:35 GMT</pubDate>
			<description>задача состоит в том, чтобы добавить тело программы в исполняемый файл. Хотел бы узнать верно ли я все понял. 
1. Так как код будет большой, я...</description>
			<content:encoded><![CDATA[<div>задача состоит в том, чтобы добавить тело программы в исполняемый файл. Хотел бы узнать верно ли я все понял.<br />
1. Так как код будет большой, я дописываю его в последнюю секцию.<br />
2. Делаю перерасчет адрессов смещения в этой секции на размер дописываемого кода (пока еще не понял каких конретно)<br />
3. Нахожу EP и впихиваю туда jmp на мой код (как высчитать адресс куда нужно прыгнуть? Какие это адресса, относительно от чего они высчитываються?)<br />
4. В конце своего кода впихиваю jmp который был записан в EP<br />
<br />
Все ли так просто или нужно будет увеличивать размер стека секции (если да, то от чего зависит увелечение)? может еще что-нибудь?<br />
<br />
Мне давно было интересно разобраться в том, как дописывает свое тело вирус и повторить это.</div>

]]></content:encoded>
			<category domain="http://www.programmersforum.ru/forumdisplay.php?f=4">Win Api</category>
			<dc:creator>liljon</dc:creator>
			<guid isPermaLink="true">http://www.programmersforum.ru/showthread.php?t=110246</guid>
		</item>
	</channel>
</rss>
