Отправляет email-рассылки с помощью сервиса Sendsay

Все обо всем

  Все выпуски  

Все обо всем Выпуск от 04.08.2003


Информационный Канал Subscribe.Ru


Все обо всем
№9 29.08.2003


Извиняюсь за то, что забыл исправить заголовок прошлого
выпуска рассылки и она вышла под старым номером 7

Возможности JavaScript и CSS

Продолжения возможно не будет, так как основной документ был утерян, а линк на него не сохранился. Но я надеюсь, что эта и последующая информация будет на столько же ценной, как и та, которая была в прошлом номере.

Visual J++ 6.0

Вопрос: как изменить картинку рабочего стола?
Ответ: Узнать текущую картинку можно из реестра:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\General, но изменение этого ключа не даст ожидаемого эффекта вплоть до перезагрузки. Но у нас есть другой путь :

int nAction = com.ms.win32.win.SPI_SETDESKWALLPAPER;
String strBMP = "c:\\winnt\\Blue Lace 16.bmp";
int bSaveChange = 0;
SystemParametersInfo(nAction,0,strBMP,nSaveChange);
Осталось только определить функцию SystemParametersInfo.

/** @dll.import("USER32",auto) */ public static native boolean SystemParametersInfo(

int uiAction,
int uiParam,
int[] pvParam,
int fWinIni);
Но нам необходимо задавать путь к картинке в виде строки, что ж, поменяем еще пару слов...

/** @dll.import("USER32",auto) */ public static native boolean SystemParametersInfo(

int uiAction,
int uiParam,
String pvParam,
int fWinIni);

Задать центрирование изображения можно изменив параметр реестра TileWallpaper в разделе HKEY_CURRENT_USER\Control Panel\Desktop\. Значение "0" - по центру, "1" - размножить.

ASP

Вопрос: как узнать язык броузера (IE)
Ответ: Необходимо использовать переменную HTTP_ACCEPT_LANGUAGE
dim userLocale
userLocale = request.servervariables("HTTP_ACCEPT_LANGUAGE")

Visual C++

Часто Вы можете видеть, что та или иная функция может использоваться только в определенной версии Windows. Как же определить эту версию? Можно воспользоваться следующей таблицей:
Minimum System Required Macros to Define
Windows 95 and Windows NT 4.0 WINVER=0x0400
Windows 98 and Windows NT 4.0 _WIN32_WINDOWS=0x0410 and WINVER=0x0400
Windows NT 4.0 _WIN32_WINNT=0x0400 and WINVER=0x0400
Windows 98 and Windows 2000 WINVER=0x0500
Windows 2000 _WIN32_WINNT=0x0500 and WINVER=0x0500
Internet Explorer 3.0 _WIN32_IE=0x0300
Internet Explorer 4.0 _WIN32_IE=0x0400
Internet Explorer 5.0 _WIN32_IE=0x0500

Работа с отладчиками

Иногда Вам, наверное, приходится отлаживать свое приложение при помощи отладчика либо Вы хотите знать, есть ли какой отладчик в системе (например, для защиты своей программы от отладчика). Что же, можно воспользоваться следующими функциями API, которые предназначены для работы с отладчиками:

Function Description
ContinueDebugEvent Enables a debugger to continue a thread that previously reported a debugging event.
DebugActiveProcess Enables a debugger to attach to an active process and debug it.
DebugBreak Causes a breakpoint exception to occur in the current process.
FatalExit Transfers execution control to the debugger.
FlushInstructionCache Flushes the instruction cache for the specified process.
GetThreadContext Retrieves the context of the specified thread.
GetThreadSelectorEntry Retrieves a descriptor table entry for the specified selector and thread.
IsDebuggerPresent Determines whether the calling process is running under the context of a debugger.
OutputDebugString Sends a string to the debugger for display.
ReadProcessMemory Reads data from an area of memory in a specified process.
SetThreadContext Sets the context for the specified thread.
WaitForDebugEvent Waits for a debugging event to occur in a process being debugged.
WriteProcessMemory Writes data to an area of memory in a specified process.

Небольшой пример из MSDN:

DEBUG_EVENT DebugEv;                   // debugging event information 
DWORD dwContinueStatus = DBG_CONTINUE; // exception continuation 
 
for(;;) 
{ 
 
// Wait for a debugging event to occur. The second parameter indicates 
// that the function does not return until a debugging event occurs. 
 
    WaitForDebugEvent(&DebugEv, INFINITE); 
 
// Process the debugging event code. 
 
    switch (DebugEv.dwDebugEventCode) 
    { 
        case EXCEPTION_DEBUG_EVENT: 
        // Process the exception code. When handling 
        // exceptions, remember to set the continuation 
        // status parameter (dwContinueStatus). This value 
        // is used by the ContinueDebugEvent function. 
 
            switch (DebugEv.u.Exception.ExceptionRecord.ExceptionCode) 
            { 
                case EXCEPTION_ACCESS_VIOLATION: 
                // First chance: Pass this on to the system. 
                // Last chance: Display an appropriate error. 
 
                case EXCEPTION_BREAKPOINT: 
                // First chance: Display the current 
                // instruction and register values. 
 
                case EXCEPTION_DATATYPE_MISALIGNMENT: 
                // First chance: Pass this on to the system. 
                // Last chance: Display an appropriate error. 
 
                case EXCEPTION_SINGLE_STEP: 
                // First chance: Update the display of the 
                // current instruction and register values. 
 
                case DBG_CONTROL_C: 
                // First chance: Pass this on to the system. 
                // Last chance: Display an appropriate error. 
 
                // Handle other exceptions. 
            } 
 
        case CREATE_THREAD_DEBUG_EVENT: 
        // As needed, examine or change the thread's registers 
        // with the GetThreadContext and SetThreadContext functions; 
        // and suspend and resume thread execution with the 
        // SuspendThread and ResumeThread functions. 
 
        case CREATE_PROCESS_DEBUG_EVENT: 
        // As needed, examine or change the registers of the 
        // process's initial thread with the GetThreadContext and 
        // SetThreadContext functions; read from and write to the 
        // process's virtual memory with the ReadProcessMemory and 
        // WriteProcessMemory functions; and suspend and resume 
        // thread execution with the SuspendThread and ResumeThread 
        // functions. 
 
        case EXIT_THREAD_DEBUG_EVENT: 
        // Display the thread's exit code. 
 
        case EXIT_PROCESS_DEBUG_EVENT: 
        // Display the process's exit code. 
 
        case LOAD_DLL_DEBUG_EVENT: 
        // Read the debugging information included in the newly 
        // loaded DLL. 
 
        case UNLOAD_DLL_DEBUG_EVENT: 
        // Display a message that the DLL has been unloaded. 
 
        case OUTPUT_DEBUG_STRING_EVENT: 
        // Display the output debugging string. 
 
    } 
 
// Resume executing the thread that reported the debugging event. 
 
ContinueDebugEvent(DebugEv.dwProcessId, 
    DebugEv.dwThreadId, dwContinueStatus); 
 
} 


Заработок в Интернет - это реальность! Зарегистрируйтесь по ссылке http://www.CashRead.com и получайте письма стоимостью до 20 центов. Обычно приходит по 6 линков в письме. Если письмо "дорогое", то ссылка одна. Учавствуя в системе менее года я накликал уже более 107$.



http://subscribe.ru/
E-mail: ask@subscribe.ru
Отписаться
Убрать рекламу

В избранное