Извините, ничего не найдено.

Не расстраивайся! Лучше выпей чайку!
Регистрация
Справка
Календарь

Вернуться   forum.boolean.name > Программирование игр для компьютеров > Blitz3D

Ответ
 
Опции темы
Старый 27.10.2007, 14:05   #1
Sleepy bear
AnyKey`щик
 
Регистрация: 17.02.2007
Сообщений: 5
Написано 0 полезных сообщений
(для 0 пользователей)
как определить открытые фомы

как в blitz3D определить открытые окна в windows. И посмотреть запущенные процессы. еще, как доратся до свойст окна windows.
(Offline)
 
Ответить с цитированием
Старый 27.10.2007, 14:55   #2
mr.DIMAS
Дэвелопер
 
Аватар для mr.DIMAS
 
Регистрация: 26.12.2006
Адрес: Санкт-Петербург
Сообщений: 1,572
Написано 547 полезных сообщений
(для 1,540 пользователей)
Re: как определить открытые фомы

Насчет процесов как-то можно(Но я не знаю как ), а начет оконо так: короче в винапи ест функция FindWindow(имя_класса_окна, название_окна), но трабла в том что как к этой ф-ции обратиться я незнаю
__________________

(Offline)
 
Ответить с цитированием
Старый 27.10.2007, 15:11   #3
Sleepy bear
AnyKey`щик
 
Регистрация: 17.02.2007
Сообщений: 5
Написано 0 полезных сообщений
(для 0 пользователей)
Re: как определить открытые фомы

Шпасиб за ответ. название функции я посмарю.

кое что нарыл.
Это описание использования WIN API функций.
только в примере на С++ ошибка. кто знает С++ иправти хотцаа пример посмареть.
New DLL interface spec
----------------------

There is now a directory in the root blitzpath called 'userlibs'.

By adding DLLs and '.decls' files to this directory, you can extend blitz's command set.

DLLs contain actually library code, while .decls files contain 'declarations' to be added to the
base command set. These declarations describe the functions contained in the Dll.


Format of decls files
---------------------

Decls files should always start with a '.lib' directive, followed by the quoted name of the DLL to be
loaded, eg:

.lib "mylib.dll"

Following the .lib is a list of function declarations. The syntax of these is identical to
function declarations in Blitz, with the following exceptions:

* No default parameter values are allowed.

* If no function return type is specified, the function is a 'void' function - ie: it returns nothing.

* Instead of object parameters, you can only specify 'void*' parameters using a '*' type tag. Such
parameters can be assigned ANY object or bank, so BE CAREFUL!

* A declaration may be optionally followed by a 'decorated name'. This takes the form of a ':'
followed by a quoted string denoting the decorated name, eg:

MyFunction( text$ ):"_MyFunction@4"
MessageBox%( hwnd,text$,title$,style ):"MessageBoxA"

The decorated name is the name of the function as it appears in the dll, and only needs to be
specified if it is different from the actual function name.


Writing DLLs
------------

All functions MUST use the _stdcall calling convention.

Floats are passed and returned as per standard C/C++ conventions.

Strings are passed and returned in 'C' format - ie: a pointer to a null-terminated sequence of
characters.

Returned strings must be in a 'static' memory buffer. Once the function returns, this string is
immediately copied into an internal Blitz style string, so its OK to share this buffer between
multiple functions.

Both banks and objects can be passed to functions. The value passed is the address of the first byte
of storage. No information is sent regarding the size or type of memory passed so, again, BE CAREFUL!

Neither Banks or objects can be returned from functions.

Arrays are not supported at all.

VisualC decorates symbols quite heavily! If you are coding in 'C', the necessary stdcall specifier
will cause a '_' to be prepended, and a '@' (followed by the number of bytes passed to the function
- ie: number of parameters*4) to be appended. So, something like: 'void _stdcall MyFunc( int x )'
will end up as '_MyFunc@4'. In C++, the name decoration is even messier! But you can supress it by
using the 'extern "C"' feature (see examples below) so you're just left with the 'C' stdcall mess.

Other languages such as Delphi and Purebasic don't appear to suffer from this feature, but it can be
worthwhile looking through dll symbols if you're having problems. Check out PEview at
http://www.magma.ca/~wjr Open your dll and select 'SECTION .rdata'/'EXPORT address table'
to have a look at the exported symbols your compiler has seen fit to bestow upon your dll.

Example
-------

Ok, here's a little C++ example, as it would appear in VisualC.

First, we write the DLL:

//demo.dll
//
#include <math.h>
#include <string.h>
#include <stdlib.h>

#define BBDECL extern "C" _declspec(dllexport)
#define BBCALL _stdcall

//returns a float and has 6 float parameters
BBDECL float BBCALL VecDistance( float x1,float y1,float z1,float x2,float y2,float z2 ){
float dx=x1-x2,dy=y1-y2,dz=z1-z2;
return sqrtf( dx*dx+dy*dy+dz*dz );
}

//returns a string and has one string parameter
BBDECL const char * BBCALL ShuffleString( const char *str ){
static char *_buf;

int sz=strlen(str);

delete[] _buf;
_buf=new char[ sz+1 ];
strcpy( _buf,str );

for( int k=0;k<sz;++k ){
int n=rand()%sz;
int t=_buf[k];_buf[k]=_buf[n];_buf[n]=t;
}

return _buf;
}
After building this, the resultant 'demo.dll' should be placed in the userlibs directory.

Now, we also need to create a 'demo.decls' file, describing the functions in our dll. This file
is also placed in the userlibs directory:

.lib "demo.dll"
VecDistance#( x1#,y1#,z1#,x2#,y2#,z2# ):"_VecDistance@24"
ShuffleString$( str$ ):"_ShuffleString@4"

...Voila! The next time Blitz is started up, the new commands appear within the IDE and can be used.
по поиску "winapi" boo;ean.name выдает много интересного. есть что почитать.

__________________________________

Подскажите кто нить манул по работе с с окна в winapi
(Offline)
 
Ответить с цитированием
Старый 27.10.2007, 15:17   #4
Sleepy bear
AnyKey`щик
 
Регистрация: 17.02.2007
Сообщений: 5
Написано 0 полезных сообщений
(для 0 пользователей)
Re: как определить открытые фомы

мож каму интересно будет

Функция FindWindow

Описание:
function FindWindow(ClassName, WindowName: PChar): HWnd;

Находит pодительское окно веpхнего уpовня с совпадающими ClassName и WindowName. Не осуществляет поиск дочеpних окон.

Паpаметpы:
ClassName: Имя класса окна (заканчивающееся пустым символом, nil - если все классы).
WindowName: Текстовый заголовок окна или 0, если все окна.

Возвpащаемое значение:
Описатель окна; 0 - если такого окна нет.

функция находится в файле user32.dll
(Offline)
 
Ответить с цитированием
Старый 27.10.2007, 22:32   #5
mr.DIMAS
Дэвелопер
 
Аватар для mr.DIMAS
 
Регистрация: 26.12.2006
Адрес: Санкт-Петербург
Сообщений: 1,572
Написано 547 полезных сообщений
(для 1,540 пользователей)
Re: как определить открытые фомы


чувак у мну есть только пример на Visual Basic 6.0, вот он:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Const SW_SHOWNORMAL = 1
Const WM_CLOSE = &H10
Const gcClassnameMSWord = "OpusApp"
Const gcClassnameMSExcel = "XLMAIN"
Const gcClassnameMSIExplorer = "IEFrame"
Const gcClassnameMSVBasic = "wndclass_desked_gsk"
Const gcClassnameNotePad = "Notepad"
Const gcClassnameMyVBApp = "ThunderForm"
Private Sub Form_Load()
'KPD-Team 1998
'URL: http://www.allapi.net/
'E-Mail: [email protected]
Dim WinWnd As Long, Ret As String, RetVal As Long, lpClassName As String
'Ask for a Window title
Ret = InputBox("Enter the exact window title:" + Chr$(13) + Chr$(10) + "Note: must be an exact match")
'Search the window
WinWnd = FindWindow(vbNullString, Ret)
If WinWnd = 0 Then MsgBox "Couldn't find the window ...": Exit Sub
'Show the window
ShowWindow WinWnd, SW_SHOWNORMAL
'Create a buffer
lpClassName = Space(256)
'retrieve the class name
RetVal = GetClassName(WinWnd, lpClassName, 256)
'Show the classname
MsgBox "Classname: " + Left$(lpClassName, RetVal)
'Post a message to the window to close itself
PostMessage WinWnd, WM_CLOSE, 0&, 0&
End Sub
Это конечно оффтоп, но может поможет

__________________

(Offline)
 
Ответить с цитированием
Ответ


Опции темы

Ваши права в разделе
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы не можете редактировать сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.

Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Помогите определить музыку в ролике ABTOMAT Болтовня 1 30.11.2008 19:06
Помогите определить музыку по фрагменту. ABTOMAT Болтовня 2 16.02.2008 23:43
Как определить, освещён энтити или нет? ABTOMAT 3D-программирование 10 16.12.2007 14:51
Как определить, какова высота меша? ABTOMAT 3D-программирование 6 30.11.2007 20:54
Как определить угол если известно ХУ NullX 2D-программирование 3 30.08.2006 12:30


Часовой пояс GMT +4, время: 22:50.


vBulletin® Version 3.6.5.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Перевод: zCarot
Style crйe par Allan - vBulletin-Ressources.com