コード例 #1
0
BOOL PrinterDialog::DoCommand(LONG command)
{
   CHAR szDeviceName[48];
   CHAR szDriverName[64];
   PPRQINFO3 pqi;

   pqi = &pSetup->pQueueInfo[list->GetSelection()];
   char *pch;

   switch (command)
   {
   case DID_OK:
      strcpy(pSetup->szPreferredQueue, (char*)pqi->pszName);
      if (check->IsSelected())
      {
         pSetup->fToFile = TRUE;
         XString buffer;

         entry->GetText(&buffer);
         strcpy(pSetup->szFileName, (char *) buffer);
      }
      else
      {
         pSetup->fToFile = FALSE;
         *pSetup->szFileName = 0;
      }
      memcpy(pTarget, pSetup, sizeof(PRINTERSETUP));
      break;
   case DID_CANCEL:
      break;
   case IDC_JOBPROP:
      strcpy(szDriverName, (char*)pqi->pszDriverName);
      pch = strchr(szDriverName, '.');
      if (pch)
      {
         strcpy(szDeviceName, pch + 1);
         *pch = 0;
      }
      else
         *szDeviceName = 0;

      pch = strchr( (char*) pqi->pszPrinters, ',');
      if (pch)
         *pch = 0;

      if (DevPostDeviceModes(pSetup->hab, pqi->pDriverData, (PSZ) szDriverName, (PSZ) szDeviceName, pqi->pszPrinters, DPDM_POSTJOBPROP) == DPDM_ERROR)
      {
         XMessageBox msgbox("Impostazione stampante", "DevPostDeviceModes", MB_OK | MB_ERROR | MB_MOVEABLE, this);
      }
      return FALSE;
   }
   return TRUE;
}
コード例 #2
0
ファイル: interface.c プロジェクト: FREEWING-JP/np2pi
void
ia32_printf(const char *str, ...)
{
	char buf[1024];
	va_list ap;
	va_start(ap, str);
	vsnprintf(buf, sizeof(buf), str, ap);
	va_end(ap);
	strcat(buf, "\n");

	msgbox("ia32_printf", buf);
}
コード例 #3
0
ファイル: util.c プロジェクト: yqhou/projects
int userlog(int debuglev, const char *file, const char *function, int line, char *fmt, ...)
{

	va_list args;
	FILE    *fp;
	int i = 0;
	char tmp[1024];
	char alTime[25];
	char fname[512];

	if (!debuglev)
		return 0;

	memset(tmp, 0x00, sizeof(tmp));
	memset(fname, 0x00, sizeof(fname));
	memset(alTime, 0x00, sizeof(alTime));

	GetTime(alTime);

	//sprintf( fname, "%s\\%s", path, debugfile );

	if ((fp = fopen(debugfile, "a+")) == NULL) {
		//msgbox( "ERROR", MB_OK, " fopen(%s) failed. %s", debugfile, strerror(errno) );
#ifdef WIN32
		GetModuleFileName(NULL, fname, sizeof(fname)-1);
#else
        memcpy( fname, "json.log", sizeof(fname)-1 );
#endif
		set_logfile(fname);
		if ((fp = fopen(debugfile, "a+")) == NULL)
		{
#ifdef WIN32
			msgbox("ERROR", MB_OK, " fopen(%s) failed. %s", debugfile, strerror(errno));
#endif
			return -1;
		}
	}

	va_start(args, fmt);
#ifdef WIN32
	fprintf(fp, "[%s][%-10s-L%04d-%-15s-%05d] ", alTime + 2, file, line, function, _getpid());
#else
	fprintf(fp, "[%s][%-10s-L%04d-%-15s-%05d] ", alTime + 2, file, line, function, getpid());
#endif
	//vfprintf( fp, "%s->.%d: %s.\n", args );

	vfprintf(fp, fmt, args);
	fprintf(fp, "%s", NEWLINE);
	va_end(args);
	fclose(fp);
	return 0;
}
コード例 #4
0
ファイル: createproc.c プロジェクト: cuckoosandbox/monitor
int main(int argc, char *argv[])
{
    pipe_init("\\\\.\\PIPE\\cuckoo", 0);

    if(argc == 1) {
        inject(argv[0]);
    }
    else {
        msgbox(argv[1]);
    }
    pipe("INFO:Test finished!");
    return 0;
}
コード例 #5
0
ファイル: svcs_rsa.cpp プロジェクト: Seldom/miranda-ng
int __cdecl rsa_check_pub(HANDLE context, PBYTE pub, int pubLen, PBYTE sig, int sigLen)
{
	int v = 0, k = 0;
	pUinKey ptr = getUinCtx(context); if (!ptr) return 0;
	LPSTR cnm = (LPSTR)mir_alloc(NAMSIZE); getContactNameA(ptr->hContact, cnm);
	LPSTR uin = (LPSTR)mir_alloc(KEYSIZE); getContactUinA(ptr->hContact, uin);
	LPSTR msg = (LPSTR)mir_alloc(MSGSIZE);
	LPSTR sha = mir_strdup(to_hex(sig, sigLen));
	LPSTR sha_old = NULL;

	Sent_NetLog("rsa_check_pub: %s %s %s", cnm, uin, sha);

	DBVARIANT dbv;
	dbv.type = DBVT_BLOB;
	if (db_get(ptr->hContact, MODULENAME, "rsa_pub", &dbv) == 0) {
		k = 1;
		PBYTE buf = (PBYTE)alloca(sigLen); int len;
		mir_exp->rsa_get_hash((PBYTE)dbv.pbVal, dbv.cpbVal, (PBYTE)buf, &len);
		sha_old = mir_strdup(to_hex(buf, len));
		db_free(&dbv);
	}
	if (bAAK) {
		if (k)	mir_snprintf(msg, MSGSIZE, Translate(sim523), cnm, uin, sha, sha_old);
		else	mir_snprintf(msg, MSGSIZE, Translate(sim521), cnm, uin, sha);
		showPopupKRmsg(ptr->hContact, msg);
		HistoryLog(ptr->hContact, msg);
		v = 1;
#if defined(_DEBUG) || defined(NETLIB_LOG)
		Sent_NetLog("rsa_check_pub: auto accepted");
#endif
	}
	else {
		if (k) mir_snprintf(msg, MSGSIZE, Translate(sim522), cnm, sha, sha_old);
		else	mir_snprintf(msg, MSGSIZE, Translate(sim520), cnm, sha);
		v = (msgbox(0, msg, MODULENAME, MB_YESNO | MB_ICONQUESTION) == IDYES);
#if defined(_DEBUG) || defined(NETLIB_LOG)
		Sent_NetLog("rsa_check_pub: manual accepted %d", v);
#endif
	}
	if (v) {
		db_set_blob(ptr->hContact, MODULENAME, "rsa_pub", pub, pubLen);
		ptr->keyLoaded = true;
	}
	mir_free(cnm);
	mir_free(uin);
	mir_free(msg);
	mir_free(sha);
	SAFE_FREE(sha_old);
	return v;
}
コード例 #6
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    this->setWindowTitle("Userfields Interface");
    init_flag=0;
    //ui->tableWidget->hideColumn(0);
    QFile config_file(".\\config.ini");

    QSettings setting(".\\config.ini",QSettings::IniFormat);

    if (!config_file.exists() || setting.status() != QSettings::NoError)
    {
        setting.setValue("filename","C:/program Files (x86)/Zeiss/CALYPSO 5.4/opt/om/protform/userfields.ini");
    }
    fileName = setting.value("filename").toString();

    QFile origin_name(fileName);
    if (!origin_name.exists())
    {
        if (origin_name.copy(":/userfields.ini",fileName))
        {
            QMessageBox msgbox(QMessageBox::Warning, tr("Warning"),
                               tr("as your file didn't exist.\nI use a default one to instead."),0,this);
            msgbox.addButton(tr("Continue"), QMessageBox::AcceptRole);
            msgbox.exec();
        }

    }
    origin_name.setPermissions(QFile::Permission(0x7777));
    origin_name.remove("./qt_settings_format.ini");
    origin_name.copy("./qt_settings_format.ini");

    QFile temp_file("./qt_settings_format.ini");
    temp_file.setPermissions(QFile::Permission(0x7777));
    calypso = new QSettings("./qt_settings_format.ini",QSettings::IniFormat);

    all_list = calypso->childGroups();
    QString str;
    foreach(str,all_list)
    {
        calypso->beginGroup(str);
        QStringList sub_list = calypso->childKeys();
        calypso->endGroup();
        if (sub_list.contains("name"))
            u_field_list.push_back(str);
        else
            u_value_list.push_back(str);
    }
コード例 #7
0
ファイル: editor.c プロジェクト: nasciiboy/ncurses
int load_elevel( char map[MAP_HSIZE][MAP_WSIZE], int elevel, int* y, int* x ){
  if( elevel >= 1 && elevel <= 11 ){
    char file[30];
    sprintf( file, "data/levels/%02i", elevel );
    if( !load_map( file, map ) ){
      msgbox( "no-load" );
      return 0;
    } else {
      *y = MAP_HSIZE / 2;
      *x = MAP_WSIZE / 2;
      draw_editor( map, HZ );
      return 1;
    }
  } else return 0;
}
コード例 #8
0
bool BootMaker::confirmFormatDlg() {
    QMessageBox msgbox(this);
    msgbox.setIcon(QMessageBox::Critical);
    msgbox.setWindowTitle(tr("Format USB flash drive"));
    msgbox.setText(tr("All data will be lost during formatting, please back up in advance and then press OK button."));
    msgbox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
    msgbox.setButtonText(QMessageBox::Ok, tr("Ok"));
    msgbox.setButtonText(QMessageBox::Cancel, tr("Cancel"));

    if(msgbox.exec() == QMessageBox::Ok) {
         return true;
    } else {
        return false;
    }
}
コード例 #9
0
ファイル: regedit.cpp プロジェクト: Cortexelus/rockbox
bool RegEdit::CloseSoc()
{
    if(!m_modified)
        return true;
    QMessageBox msgbox(QMessageBox::Question, "Save changes ?", 
        "The description has been modified. Do you want to save your changes ?",
        QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, this);
    msgbox.setDefaultButton(QMessageBox::Cancel);
    int ret = msgbox.exec();
    if(ret == QMessageBox::Discard)
        return true;
    if(ret == QMessageBox::Cancel)
        return false;
    return SaveSoc();
}
コード例 #10
0
ファイル: ggzclient.c プロジェクト: ralight/ggz
static GGZHookReturn ggz_table_leave_fail(GGZRoomEvent id,
					  const void *event_data,
					  const void *user_data)
{
	gchar *msg;
	const char *event_message = event_data;

	msg = g_strdup_printf(_("Error leaving table: %s"),
			      event_message);
	msgbox(msg, _("Error"),
	       MSGBOX_OKONLY, MSGBOX_STOP, MSGBOX_NORMAL);
	g_free(msg);

	return GGZ_HOOK_OK;
}
コード例 #11
0
ファイル: regedit.cpp プロジェクト: Cortexelus/rockbox
void RegEdit::OnSocItemDelete()
{
    QTreeWidgetItem *current = m_soc_tree->currentItem();
    if(current == 0)
        return;
    QMessageBox msgbox(QMessageBox::Question, "Delete item ?",
        "Are you sure you want to delete this item ?",
        QMessageBox::Yes | QMessageBox::No, this);
    msgbox.setDefaultButton(QMessageBox::No);
    int ret = msgbox.exec();
    if(ret != QMessageBox::Yes)
        return;
    if(current->type() == SocTreeSocType)
    {
        SocTreeItem *item = dynamic_cast< SocTreeItem * >(current);
        item->GetRef().GetSoc().dev.clear();
        item->takeChildren();
        FillSocTreeItem(item);
        m_soc_tree->expandItem(item);
    }
    else if(current->type() == SocTreeDevType)
    {
        DevTreeItem *item = dynamic_cast< DevTreeItem * >(current);
        my_remove_at(item->GetRef().GetSoc().dev, item->GetRef().GetDevIndex());
        QTreeWidgetItem *parent = item->parent();
        parent->takeChildren();
        FillSocTreeItem(parent);
        m_soc_tree->expandItem(parent);
    }
    else if(current->type() == SocTreeRegType)
    {
        RegTreeItem *item = dynamic_cast< RegTreeItem * >(current);
        my_remove_at(item->GetRef().GetDev().reg, item->GetRef().GetRegIndex());
        QTreeWidgetItem *parent = item->parent();
        parent->takeChildren();
        FillDevTreeItem(parent);
        m_soc_tree->expandItem(parent);
    }
    else if(current->type() == SocTreeFieldType)
    {
        FieldTreeItem *item = dynamic_cast< FieldTreeItem * >(current);
        my_remove_at(item->GetRef().GetReg().field, item->GetRef().GetFieldIndex());
        QTreeWidgetItem *parent = item->parent();
        parent->takeChildren();
        FillRegTreeItem(parent);
        m_soc_tree->expandItem(parent);
    }
}
コード例 #12
0
void DLRacerInterface::printWarning(CString strWarning)
{
	msgbox(strWarning);
// 	for (int i = 0; i < strWarning.GetLength(); i ++)
// 	{
// 		char c = strWarning[i];
// 		if (c == 9)
// 		{
// 			//cout << endl;
// 		}
// 		else
// 		{
// 			msgbox(strWarning[i]);
// 		}
// 	}
}
コード例 #13
0
ファイル: game.c プロジェクト: ralight/ggz
int game_launch(void)
{
	gint status;
	GGZGame *game = ggzcore_server_get_cur_game(ggz_gtk.server);

	/* Launch game */
	if ((status = ggzcore_game_launch(game) < 0)) {
		msgbox(_("Failed to execute game module.\n Launch aborted."),
		       _("Launch Error"), MSGBOX_OKONLY, MSGBOX_STOP,
		       MSGBOX_NORMAL);
		game_destroy();
		return -1;
	}

	return 0;
}
コード例 #14
0
ファイル: IPCamGeniusDlg.cpp プロジェクト: 119/IPCamGenius
void CIPCamGeniusDlg::OnBnClickedButtonAccessCamera()
{
	char buf[10];
	POSITION pos = m_list_cameras.GetFirstSelectedItemPosition();
	int idx = m_list_cameras.GetNextSelectedItem(pos);
	if (idx < 0) {
		msgbox("ÇëÏÈÑ¡ÔñÉãÏñ»ú");
		return;
	}
	
	IPCameraInfo ipcaminfo = network_controller.vec_info[idx];

	CString s_ip(ipcaminfo.ip), s_port(_itoa(ipcaminfo.port_http, buf, 10));
	CString url = _T("http://") + s_ip + _T(":") + s_port + _T("/");
	ShellExecute(m_hWnd, NULL, url, NULL, NULL, SW_SHOWMAXIMIZED);
}
コード例 #15
0
ファイル: ggzclient.c プロジェクト: ralight/ggz
static GGZHookReturn ggz_entered_fail(GGZServerEvent id,
				      const void *event_data,
				      const void *user_data)
{
	gchar *msg;
	const char *event_message = event_data;

	msg =
	    g_strdup_printf(_("Error joining room: %s"),
			    event_message);
	msgbox(msg, _("Error"),
	       MSGBOX_OKONLY, MSGBOX_STOP, MSGBOX_NORMAL);
	g_free(msg);

	return GGZ_HOOK_OK;
}
コード例 #16
0
ファイル: error.cpp プロジェクト: arthuraa/quadra
void fatal_msgbox(const char* m, ...) {
	delete_obj();
	ShowCursor(TRUE);
	MSG msg;
	while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}
	char st[1024];
	va_list marker;
	va_start(marker, m);
	vsprintf(st, m, marker);
	va_end(marker);
	msgbox("Error::Error: %s\n", st);
	MessageBox(NULL, st, "Error", MB_ICONEXCLAMATION);
	exit(1);
}
コード例 #17
0
ファイル: codeeditor.cpp プロジェクト: AG3/Lucky_OIer
void codeEditor::close()
{
    if(isModified())
    {
        QMessageBox msgbox(this);

        msgbox.setText(tr("The document has been modified."));
        msgbox.setInformativeText(tr("Do you want to save your changes?"));
        msgbox.setDefaultButton(QMessageBox::Save);
        msgbox.setStandardButtons(QMessageBox::Discard|QMessageBox::Cancel);

        int ret=msgbox.exec();

        switch (ret)
        {
        case QMessageBox::Save:
            // Save was clicked
            if(!save())
            {
                //Save file failed

            }

            break;
        case QMessageBox::Discard:
            // Don't Save was clicked


            break;
        case QMessageBox::Cancel:
            // Cancel was clicked
            return ;

            break;
        default:
            // should never be reached
            qWarning("codeeditor.cpp: switch(ret) reached an unexcepted code!");
            break;
        }
    }



    deleteLater();
}
コード例 #18
0
ファイル: ggzclient.c プロジェクト: ralight/ggz
static GGZHookReturn ggz_connect_fail(GGZServerEvent id,
				      const void *event_data,
				      const void *user_data)
{
	gchar *msg;
	const char *event_message = event_data;

	msg =
	    g_strdup_printf(_("Error connecting to server: %s"),
			    event_message);
	msgbox(msg, _("Error"),
	       MSGBOX_OKONLY, MSGBOX_STOP, MSGBOX_NORMAL);
	g_free(msg);

	login_connect_failed();

	return GGZ_HOOK_OK;
}
コード例 #19
0
ファイル: IPCamGeniusDlg.cpp プロジェクト: 119/IPCamGenius
BOOL CIPCamGeniusDlg::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	SetIcon(m_hIcon, TRUE);
	SetIcon(m_hIcon, FALSE);

	CRect r;
	m_dialog_wifi_list.Create(IDD_DIALOG_WIFILIST, this);
	GetDlgItem(IDC_STATIC_GROUPBOX_WIFILIST)->GetWindowRect(r);
	ScreenToClient(r);
	GetDlgItem(IDC_STATIC_GROUPBOX_WIFILIST)->DestroyWindow();
	m_dialog_wifi_list.MoveWindow(r);
	m_dialog_wifi_list.ShowWindow(SW_HIDE);

	m_dialog_wifi_auth.Create(IDD_DIALOG_WIFI_AUTH, this);
	GetDlgItem(IDC_STATIC_GROUPBOX_WIFIAUTH)->GetWindowRect(r);
	ScreenToClient(r);
	GetDlgItem(IDC_STATIC_GROUPBOX_WIFIAUTH)->DestroyWindow();
	m_dialog_wifi_auth.MoveWindow(r);
	m_dialog_wifi_auth.ShowWindow(SW_HIDE);

	f_list_camera_info_clear();
	f_list_cameras_clear();

	if (!initSocket()) {
		msgbox("Socket³õʼ»¯Ê§°Ü£¡");
		CDialogEx::OnCancel();
	}

	CreateThread(0, 0, t_gateway_startup, this, 0, NULL);
	CreateThread(0, 0, t_send_packets, this, 0, NULL);

	void **args;
	for (int i = 0; i < network_controller.camera_adapters_num; i++) {
		args = new void*[2];
		args[0] = this;
		args[1] = new int(i);
		CreateThread(0, 0, t_recv_packets, args, 0, NULL);
	}

	CenterWindow();
	return TRUE;
}
コード例 #20
0
ファイル: updater.cpp プロジェクト: iPenguin/NotePages
void Updater::httpFinished()
{
    if (httpRequestAborted) {
        reply->deleteLater();
        return;
    }

    QString data = QString(mData);
        
    if (reply->error()) {
        //TODO: add a warning.
        qWarning() << "Failed to connect to server.";
    } else {

        QStringList urls = data.split("::", QString::SkipEmptyParts);
        if(urls.count() == 2) {
            QMessageBox msgbox(this);
            msgbox.setIcon(QMessageBox::Information);
            msgbox.setText(tr("There is a new version of %1.").arg(AppInfo::inst()->appName));
            msgbox.setInformativeText(tr("Would you like to download the new version?"));
            /*QPushButton* downloadNow =*/ msgbox.addButton(tr("Download the new version"), QMessageBox::ActionRole);
            QPushButton* seeNotes    = msgbox.addButton(tr("See what has changed"), QMessageBox::HelpRole);
            QPushButton* remindLater = msgbox.addButton(tr("Remind me later"), QMessageBox::RejectRole);

            msgbox.exec();

            if(msgbox.clickedButton() == remindLater)
                return;
            if(msgbox.clickedButton() == seeNotes) {
                QDesktopServices::openUrl(QUrl(urls.last()));
                return;
            }
                
            downloadInstaller(QUrl(urls.first()));
            
        } else if(!mSilent) {
            QMessageBox::information(this, tr("No updates available"),
                            tr("There are no updates available for %1 at this time.").arg(AppInfo::inst()->appName), QMessageBox::Ok);
        }
    }
    
    reply->deleteLater();
    reply = 0;
}
コード例 #21
0
ファイル: net_stuff.cpp プロジェクト: arthuraa/quadra
void Quadra_param::client_deconnect(Net_connection *adr) {
	if(!adr)
		return;
	msgbox("Quadra_param::client_deconnect(%x)\n", adr);
	if(game)
		game->net_list.client_deconnect(adr);
	char st[64], st1[256];
	Net::stringaddress(st, adr->address(), adr->getdestport());

	Packet_serverlog log("disconnect");
	log.add(Packet_serverlog::Var("id", adr->id()));
	if(game && game->net_server)
		game->net_server->record_packet(&log);

	sprintf(st1, "Connection closed from [%s]", st);
	message(-1, st1, true, false, true);
	if(!game)
		return;
	for(int j=0; j<MAXPLAYERS; j++) {
		Canvas *c = game->net_list.get(j);
		if(c && c->remote_adr == adr) {
			c->remote_adr = NULL; // this net_connection is now destroyed
			if(c->idle != 3) { 
				/* sends an automatic 'P_GONE' for every active players of the client that has been disconnected.  */
				if(c->idle != 2 && !c->dying) {
					Packet_dead d;
					d.player = j;
					d.then_gone = true;
					net->dispatch(&d, P_DEAD);
					if(game->net_server)
						game->net_server->record_packet(&d);
				}
				else {
					Packet_gone p;
					p.player = j;
					net->dispatch(&p, P_GONE);
					if(game->net_server)
						game->net_server->record_packet(&p);
				}
			}
		}
	}
}
コード例 #22
0
ファイル: ggzclient.c プロジェクト: ralight/ggz
static GGZHookReturn ggz_table_launch_fail(GGZRoomEvent id,
					   const void *event_data,
					   const void *user_data)
{
	gchar *msg;
	const GGZErrorEventData *error = event_data;
	const char *event_message = error->message;

	msg =
	    g_strdup_printf(_("Error launching table: %s"),
			    event_message);
	msgbox(msg, _("Error"),
	       MSGBOX_OKONLY, MSGBOX_STOP, MSGBOX_NORMAL);
	g_free(msg);

	game_quit();

	return GGZ_HOOK_OK;
}
コード例 #23
0
ファイル: ggzclient.c プロジェクト: ralight/ggz
static GGZHookReturn ggz_logged_in(GGZServerEvent id,
				   const void *event_data,
				   const void *user_data)
{
	const gchar *password;
	gchar *message;

	if (ggz_gtk.connected_cb) {
		ggz_gtk.connected_cb(ggz_gtk.server);
	}

	/* Set title */
	if (!ggz_gtk.embedded_protocol_engine) {
		gchar *title;

		title = g_strdup_printf("GGZ Gaming Zone - [%s:%d]",
					ggzcore_server_get_host(ggz_gtk.server),
					ggzcore_server_get_port(ggz_gtk.server));
		gtk_window_set_title(GTK_WINDOW(ggz_gtk.main_window), title);
		g_free(title);
	}

	main_activate();
	ggzcore_server_add_event_hook(ggz_gtk.server, GGZ_ROOM_LIST,
				      ggz_auto_join);
	ggzcore_server_list_gametypes(ggz_gtk.server, 1);
	ggzcore_server_list_rooms(ggz_gtk.server, 1);


	/* If this was a first-time login, get the password from the server */
	if (ggzcore_server_get_type(ggz_gtk.server) == GGZ_LOGIN_NEW) {
		password = ggzcore_server_get_password(ggz_gtk.server);
		message =
		    g_strdup_printf(_("Your new password is %s"),
				    password);
		msgbox(message, _("New password"), MSGBOX_OKONLY,
		       MSGBOX_INFO, MSGBOX_NORMAL);
		g_free(message);
	}

	return GGZ_HOOK_OK;
}
コード例 #24
0
ファイル: ir_capture.c プロジェクト: elmo2k3/McBetty
void RAW_allkeyserase(FORM* form, CONTROL* control) {
	unsigned char x;
	
	x=msgbox(50,BC_YesNo | BC_DefaultButton2,"Moechten Sie wirklich\nalle Tasten loeschen?\n");
	if(x == BC_Yes) {
		for(x=0;x<38;x++) {
			clear_cmd(&(((struct RAWset_*)(form->tag))->RAWcmd[x]));
			
		}
	}
	/*
	unsigned long y;
	unsigned char* z;
	z=(struct RAWset_*)(form->tag);
	for(y=0;y<sizeof(struct RAWset_);y++)
		z[y]=y & 0xff;
	((struct RAWset_*)(form->tag))->name[0] = 0;
	*/
	form_draw(form);
}
コード例 #25
0
ファイル: ir_capture.c プロジェクト: elmo2k3/McBetty
void RAW_keyerase(FORM* form, CONTROL* control) {
	unsigned char x;
	
	x=msgbox(50,BC_nobuttons,"\nZu loeschende Taste\ndruecken.\n");
	waitKeyDown();
	x=getKeynum();
	if(x>3) {
			/*
			unsigned short y;
			unsigned char* z;
			z=&((struct RAWset_*)(form->tag))->RAWcmd[x-4];
			for(y=0;y<sizeof(struct RAWcmd_);y++) {
				z[y]=x;
			}*/
	
	
		clear_cmd(&(((struct RAWset_*)(form->tag))->RAWcmd[x-4]));
	}
	form_draw(form);
}
コード例 #26
0
BOOL DLRacerInterface::openConnection()
{
	int result;

	
	racerSocket = socket(AF_INET, SOCK_STREAM, 0);

	//CMainFrame *pMainFrm = (CMainFrame*) AfxGetMainWnd();
	//WSAAsyncSelect(racerSocket, pMainFrm->m_hWnd, WM_SOCKET, FD_ACCEPT | FD_CLOSE | FD_READ | FD_WRITE);
	if(racerSocket == INVALID_SOCKET)
	{
		msgbox(_T("openConnection"));
		return FALSE;
	}
	else
	{
		racerAddr.sin_family = AF_INET;
		racerAddr.sin_port = htons(m_iPort); 
		racerAddr.sin_addr.s_addr = inet_addr(_bstr_t(m_strIP));
		result = connect(racerSocket, (SOCKADDR*) &racerAddr, sizeof(racerAddr));
		if (result == -1)
		{
			//msgbox(_T("openConnection"));
			int dwError = WSAGetLastError(); //akisn0w
			if (dwError == 10035)
			{
				//远程没启动,还算正常
				return FALSE;
			}
			else
			{
				MyMessageBox_Error(_T("openConnection"));
				return FALSE;
			}
		}
		else
		{
			return TRUE;
		}
	}
}
コード例 #27
0
ファイル: IPCamGeniusDlg.cpp プロジェクト: 119/IPCamGenius
void CIPCamGeniusDlg::OnBnClickedButtonWifiConfig()
{
	POSITION pos = m_list_cameras.GetFirstSelectedItemPosition();
	int idx = m_list_cameras.GetNextSelectedItem(pos);
	if (idx < 0) {
		msgbox("ÇëÏÈÑ¡ÔñÉãÏñ»ú");
		return;
	}

	isWifiButtonClicked = !isWifiButtonClicked;

	if (!isWifiButtonClicked) {
		reset_ui();
		return;
	}
	GetDlgItem(IDC_BUTTON_ONEKEY_CONFIG)->ShowWindow(SW_HIDE);
	m_dialog_wifi_list.ShowWindow(SW_SHOW);
	m_dialog_wifi_list.setPointer(this);
	m_dialog_wifi_list.setIPCameraInfo(network_controller.vec_info[idx]);
	m_dialog_wifi_list.f_wifi_list_refresh();
}
コード例 #28
0
void StitchLibraryUi::removeSet()
{
    
    QMessageBox msgbox(this);
    msgbox.setText(tr("This will remove the set and it's associated files."));
    msgbox.setInformativeText(tr("Are you sure you want to remove the set?"));
    msgbox.setIcon(QMessageBox::Question);
    QPushButton* remove = msgbox.addButton(tr("Yes, remove the set and it's files"),QMessageBox::AcceptRole);
    /*QPushButton* keep =*/ msgbox.addButton(tr("No, keep the set as is"), QMessageBox::RejectRole);

    msgbox.exec();
    if(msgbox.clickedButton() != remove)
        return;
    
    QString setName = ui->stitchSource->currentText();

    StitchLibrary::inst()->removeSet(setName);

    //switch to the master set.
    updateSourceDropDown(StitchLibrary::inst()->masterStitchSet()->name());

}
コード例 #29
0
ファイル: game.c プロジェクト: nasciiboy/ncurses
int load_level( char map[MAP_HSIZE][MAP_WSIZE], int nlevel, gps* player, int* diamonds ){
  *diamonds = 0;
  if( nlevel >= 1 && nlevel <= 11 ){
    char file[30];
    sprintf( file, "data/levels/%02i", nlevel );
    if( !load_map( file, map ) ){
      msgbox( "no-load level" );
      return 0;
    }

    int i, ii;
    for(i = 0; i < MAP_HSIZE; i++)
      for(ii = 0; ii < MAP_WSIZE; ii++){
        if( map[i][ii] == DIAMOND ) (*diamonds)++;
        if( map[i][ii] == PLAYER ){ 
          player->y = i;
          player->x = ii;
        }
      }

    return 1;
  } else return 0;
}
コード例 #30
0
ファイル: mainwindow.cpp プロジェクト: paule32/kBase
void MainWindow::EditRunCode()
{
    ChildWindowEditor *editor;
    editor = dynamic_cast<ChildWindowEditor*>(ui->mdiArea->subWindowList().at(_EditorWindow));

    if (editor->editWidget->editWidget->document()->toPlainText().toStdString().length() < 1) {
        return;
    }
    if (editor->editWidget->editWidget->EditorFileName.length() < 0) {
        EditSaveFileAs();
    }

    if (editor->editWidget->editWidget->document()->isModified() == true) {
        EditSaveFile();
        editor->editWidget->editWidget->document()->setModified(false);
    }

    QString src = editor->editWidget->editWidget->EditorFileName;
    int lines = editor->editWidget->editWidget->lines;
    prepare_compile_file(src.toStdString().c_str());
    msgbox(QString("Information"),QString("Zeilen: %1\nKonvertierung abgeschlossen.").
    arg(lines));
}