bool USplashWindow::setTransparentColor(huys::Color clr) { _clrTrans = clr; #if defined(_MSC_VER) && (_MSC_VER > 1200) this->modifyExStyles(WS_EX_LAYERED); ::SetLayeredWindowAttributes(*this, _clrTrans, 0, LWA_COLORKEY); #else #ifndef LWA_COLORKEY #define LWA_COLORKEY 1 #endif #ifndef WS_EX_LAYERED #define WS_EX_LAYERED 0x00080000 #endif this->modifyExStyles(WS_EX_LAYERED); UDllMan dlm(_T("user32.dll")); #ifdef _MSC_VER typedef BOOL (WINAPI *PFSetLayeredWindowAttributes)(HWND, COLORREF, BYTE, DWORD); PFSetLayeredWindowAttributes foo = (PFSetLayeredWindowAttributes)dlm.find(_T("SetLayeredWindowAttributes")); foo(*this, _clrTrans, 0, LWA_COLORKEY); #else dlm.callFunc<BOOL, HWND, COLORREF, BYTE, DWORD>(_T("SetLayeredWindowAttributes"), *this, _clrTrans, 0, LWA_COLORKEY); #endif #endif // (_MFC_VER > 1200) return true; }
//----------------------------------------------------------------------------- void MainWindow::showHelp() { QString s = edit->selection(), dlm(" #;:\t"); int i, n = s.length(); for(i=0;i<n;i++) if(dlm.contains(s[i])) break; s.truncate(i); // s = s.section(' ',0); showHelpMGL(hlp,s); }
void MainWindow::editPosChanged() { QString text = edit->selection(), dlm(" #;:\t"); int n = text.length(), i; for(i=0;i<n;i++) if(dlm.contains(text[i])) break; text.truncate(i); QByteArray qxtext = text.toLatin1(); const char *ctext = qxtext.constData(); const char *desc = parser.CmdDesc(ctext); const char *form = parser.CmdFormat(ctext); if(form) setStatus(QString(desc)+": "+QString(form)); else setStatus(_("Not recognized")); }